Spring - Could not find key 'could not find key' logging.exception-conversion-word '

My Spring-Boot-Batch app is working fine and all entries seem to be working as expected. I am using Logback and have a logback-spring.xml file that reads and seems to have everything configured correctly. However, every time I run the program, I get this:

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 don't have the specified properties in my files, so this is correct in this statement, but what I can't find when searching on Google: what is looking for those properties? Since I don't seem to need the properties specified, how can I stop it from searching? If I need to add them, what are the possible values ​​and how are they used?

None of my other Spring-Boot-Batch applications have these properties and are not throwing this error.

+3


source to share


3 answers


If you just need to stop printing, you can add debug=false

to your application.properties file.



Oddly enough, adding is debug=true

n't enough to bring them back.

+2


source


It seems that spring application is not getting these properties from anywhere.
You can install them in two ways.

  • Create a file named application.properties

    and set properties there, Example: logging.pattern.console=example

  • The second way - send them at runtime when you run .jar

    , Example: java -jar example.jar --logging.pattern.console=example

    .



More on properties in Spring

, application.properties , and External Setting

+1


source


Came to this looking for something else, but in a nutshell - don't worry about them. This spring-boots autoconfiguration looks for these properties and if it doesn't find them then no harm will be done.

These are useful properties if you don't want to use your own spring.xml log, which makes configuration a lot easier. Your logback-spring.xml will override these properties anyway.

+1


source







All Articles