VydorScope
VydorScope

Reputation: 719

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.

Upvotes: 4

Views: 8566

Answers (3)

Clayton
Clayton

Reputation: 76

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.

Upvotes: 2

Matt
Matt

Reputation: 115

Came across this while looking for something else, but in a nutshell - don't worry about them. This is spring-boots autoconfiguration looking for those properties, and if it doesn't find them then there's no harm done.

These are useful properties if you don't want to use your own logback-spring.xml, essentially making it a little simpler to configure. Your logback-spring.xml will override these properties anyway.

Upvotes: 1

Daniel Taub
Daniel Taub

Reputation: 5389

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

Upvotes: 1

Related Questions