troubleshooting Question

Using Java Util Logging

Avatar of abuyusuf
abuyusuf asked on
Java
5 Comments1 Solution465 ViewsLast Modified:
I am using Java util logging to log information - I am also using a custom formatter - the custom formatter works fine however the issue that I am facing is that the log file refreshes each time and I loose the old information. The following is the structure of my property file. How can I ensure that the information gets logged to the same file and a new file does not get generated each time.

# The following creates two handlers
handlers=java.util.logging.FileHandler
 
# Set the default logging level for the root logger
.level = INFO
   
# Set the default logging level for new FileHandler instances
java.util.logging.FileHandler.level = INFO
   
# Set the default formatter for new ConsoleHandler instances
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
   
# The custom logging properties file is loaded by specifying a system property on the command line:
# java -Djava.util.logging.config.file=mylogging.properties <class>

Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros