REQUIREMENT admin.logging |
Type | NEW |
Priority | HIGH |
Status | CLOSED |
Topic | XmlBlaster uses the JDK 1.4 logging framework | ||||||||||||
Des cription |
All logging output from xmlBlaster is done with the JDK 1.4 logging framework.
This was introduced to xmlBlaster version 1.1.2, replacing the outdated jutils logging framework.
Our configuration file is We provide two xmlBlaster specific components to adjust the logging to our needs. The first is an own formatter called The other extension is a log event listener called The logging.properties file can be set on command line with java -Djava.util.logging.config.file=myLog.properties Upgrading from jutils logging
If you have written your own plugins and are upgrading from xmlBlaster before 1.1.1,
your plugins will not compile anymore as the org.jutils package is removed.
You can manually change your logging code to java.utils.logging, or if you prefer,
try our helper script Note that the old command line settings to change the logging level are not supported anymore: # Is NOT supported anymore: java org.xmlBlaster.Main -trace[core] true -dump true The new command line syntax is shown in the example section below. |
||||||||||||
Example Java |
Command line configuration It is possible to set all logging levels on command line, those settings
have precedence over the settings in Dump all calls into the core and dumps all
Switches on logging but limits the output of the |
||||||||||||
Example Java |
Example of logging.properties #----------------------------------------------------------------------------- # Name: xmlBlasterJdk14Logging.properties # Project: xmlBlaster.org # Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file # # Comment: Configure JDK 1.4 java.util.logging output # # Levels: FINEST # FINER # FINE # INFO # WARNING # SEVERE # CONFIG # # Force the logging property file: # java -Djava.util.logging.config.file=$XMLBLASTER_HOME/config/logging.properties ... # # Configure logging from command line: # -logging FINE # -/node/heron/logging FINE # -logging/org.xmlBlaster.engine FINE # -/node/heron/logging/org.xmlBlaster.engine FINE #----------------------------------------------------------------------------- # "handlers" specifies a comma separated list of log Handler # classes. These handlers will be installed during VM startup. # Note that these classes must be on the system classpath. # By default we only configure a ConsoleHandler, which will only # show messages at the INFO and above levels. handlers= java.util.logging.ConsoleHandler, org.xmlBlaster.util.log.XbNotifyHandler # To also add the FileHandler, use the following line instead. #handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler # Default global logging level. # This specifies which kinds of events are logged across # all loggers. For any given facility this global level # can be overriden by a facility specific level # Note that the ConsoleHandler also has a separate level # setting to limit messages printed to the console. .level= INFO ############################################################ # Handler specific properties. # Describes specific configuration info for Handlers. ############################################################ # default file output is in user's home directory. 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 # Limit the message that are printed on the console to INFO and above. java.util.logging.ConsoleHandler.level = INFO #java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.ConsoleHandler.formatter = org.xmlBlaster.util.log.XbFormatter ############################################################ # Facility specific properties. # Provides extra control for each logger. ############################################################ # For example, set the com.xyz.foo logger to only log SEVERE org.xmlBlaster.engine.level = INFO #org.xmlBlaster.engine.handlers=org.xmlBlaster.util.log.XbHandler #org.xmlBlaster.engine.useParentHandlers=false #org.xmlBlaster.engine.config=org.xmlBlaster.util.log.XbConfig |
||||||||||||
Configure |
These parameters allow to configure the logging, other java.util.logging specific settings are supported as well, please consult the Java logging documentation.
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details. |
||||||||||||
See API | Colorful formatting | ||||||||||||
See API | Listener for SEVERE and WARNING events | ||||||||||||
See | JDK 1.4 logging intro | ||||||||||||
See | JDK 1.4 API |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/admin.logging.xml