Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-694

The file to configure logger can be specified in a library property

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 6.0.0
    • None
    • None

      Example,

      <library-property>
      	<name>org.zkoss.util.logging.config.file</name>
      	<value>conf/zk-log.properties</value>
      </library-property>
      

      Like java.util.logging.LogManager, you can specify the handler in the configuration file. For servers that doesn't turn on Java Logger, you have to specify the handler here. For example, Jetty doesn't turn on by default, so you could put the following content:

      handlers = java.util.logging.ConsoleHandler
      
      java.util.logging.ConsoleHandler.level = FINER
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
      
      org.zkoss.bind=FINE
      

      Or you'd like to log to both console and a file.

      handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
      
      java.util.logging.ConsoleHandler.level = FINER
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
      
      java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
      java.util.logging.FileHandler.pattern = /var/log/jetty6/solr-%u.log
      java.util.logging.FileHandler.level = FINER
      
      org.zkoss.bind=FINE
      

      If Java Logger is default ON (such as Tomcat), you don't need to specify the handler:

      org.zkoss.bind=FINE
      

            Unassigned Unassigned
            tomyeh tomyeh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h