handlers=java.util.logging.ConsoleHandler .level=INFO java.util.logging.FileHandler.pattern = %h/java%u.log java.util.logging.FileHandler.limit = 50000 java.util.logging.FileHandler.count = 1 java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter java.util.logging.ConsoleHandler.level = INFO java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter com.xyz.foo.level = SEVERE
To customize logging a custom logging.properties file should be created in the project directory. The location of this file must be passed to the JVM as asystem property. This can be done on the command line like so:
$JAVA_HOME/java -Djava.util.logging.config.file=$HOME/myapp/logging.properties -classpath $HOME/myapp/target/classes com.myapp.Main
Alternatively LogManager#readConfiguration(InputStream) can be used to pass it the desired configuration.
- Enable header wire + context logging - Best for Debugging
.level = INFO handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.ConsoleHandler.level = ALL org.apache.http.level = FINEST org.apache.http.wire.level = SEVERE
Read full article from Apache HttpComponents - HttpClient Logging Practices
No comments:
Post a Comment