|
|
|||||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
SyslogChannelLog | An implementation of the org.apache.commons.logging.Log interface. |
SyslogChannelLogFactory | A subclass of the org.apache.commons.logging.LogFactory class. |
Apache Jakarta Commons Logging integration. See http://jakarta.apache.org/commons/logging.html for more information.
Adapter classes for configuring the Commons Logging system to use Syslog as the log implementation.
You can configure the Commons Logging system by creating a file called "commons-logging.properties" in your CLASSPATH with the following properties:
## ## Tells the Apache Jakarta Commons Logging package ## to use the Syslog adapter. ## org.apache.commons.logging.LogFactory = com.protomatter.syslog.commons.SyslogChannelLogFactory ## ## XML configuration file for syslog. Required. ## Syslog.config.xml = syslog.xml ## ## XML parser class name. Optional. You should only ## have to specify this if you get an exception loading ## the parser while configuring the adapter. ## Syslog.xml.parser = org.apache.xerces.parsers.SAXParser ## ## Display the classloader warning if we're not being ## loaded by the system classloader? Optional, ## default is "on" ## Syslog.classloader.warning = off |
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ... Log log = LogFactory.getLog("foo.bar"); log.info("This is an info message"); log.error("This is an error message"); log.error("This is an error message", new Exception("Blah!")); ... Log log = LogFactory.getLog(SomeClass.class); log.debug("This is an info message"); log.warn("This is an error message"); log.warn("This is an error message", new Exception("Blah!")); |
Note that if you use these classes, and don't have Syslog configured to compute the caller class and method, then the caller name in your logs will be incorrect. This is because the Apache Jakarta Commons Logging API doesn't have a mechanism for directly getting a reference to the caller.
|
Protomatter Software v1.1.8 Copyright 1998-2002 Nate Sammons |
||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
Protomatter Software v1.1.8 | http://protomatter.sourceforge.net/1.1.8 |