Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 376
VydorScope Avatar asked Sep 05 '25 03:09

VydorScope


2 Answers

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.

like image 92
Clayton Avatar answered Sep 07 '25 22:09

Clayton


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

like image 29
Daniel Taub Avatar answered Sep 07 '25 23:09

Daniel Taub