Source Code : Configuring Logger Default Values with a Properties File

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Configuring Logger Default Values with a Properties File

     

# The following creates two handlers
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
    
# Set the default logging level for the root logger
.level = ALL
    
# Set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level = INFO
    
# Set the default logging level for new FileHandler instances
java.util.logging.FileHandler.level = ALL
    
# Set the default formatter for new ConsoleHandler instances
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    
# Set the default logging level for the logger named com.mycompany
com.mycompany.level = ALL

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>

   
    
    
    
    
  

Thank with us