My Spring-Boot-Batch app is running fine, and it appears all logging is working as expected. I am using Logback and have a logback-spring.xml file that is being read and appears to be setting everything up correctly. However, every time I run the program get the following:
13:12:32.538 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key 'logging.exception-conversion-word' in any property source
13:12:32.553 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key 'logging.pattern.console' in any property source
13:12:32.553 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key 'logging.pattern.file' in any property source
13:12:32.553 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key 'logging.pattern.level' in any property source
2017-05-09 13:12:32,804 1187 DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'logging.register-shutdown-hook' in any property source
I do not have said properties in my files, so it is correct in that statement, but what I can not find through Google searching is: What is looking for those properties? Since I do not seem to need said properties, how do I stop it from looking for them? If I need to add them, what are the possible values and how are they being used?
None of my other Spring-Boot-Batch applications have these properties, nor are they throwing this error.
If you'd simply like them to stop printing, you can add debug=false
to your application.properties file.
Oddly enough, adding debug=true
isn't enough to bring them back, either.
It's seems the spring application doesn't get those properties from anywhere.
You can set them in two ways
Create file with name of application.properties
and set there the properties,
Example : logging.pattern.console=example
The second way is to send them at runtime when you running your .jar
,
Example : java -jar example.jar --logging.pattern.console=example
.
Read more about properties in
Spring
, application.properties ,and Externalized Configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With