My app uses many libraries and I'm using java.util.logging
for logging. I'd like to be able to set different logging levels for each library by doing something like:
org.datanucleus.*.level = WARNING
com.google.apphosting.*.level = WARNING
com.myapp.*.level = FINE
Is is possible?
I was able to get it working like this:
It would have been nice to control logging using only
logging.properties
:Unfortunately, the corresponding log must have actually been created. Changing your conf file won't do that work for you. Add the loggers yourself and it will work:
Nested loggers in your application work the same way:
You shouldn't use "*". A sample logging.properties could be such as:
And if all "org" level should be logged as WARNING then