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

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

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.0.0
    • Component/s: None

      Description

      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
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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