|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.provider.log.Log4JProvider
LogProvider that uses Categories of Log4J, see the Log4J website for more details.
There are corresponding methods for isDebugEnabled() , isInfoEnabled() etc. to save the overhead of building the log string if the appropriate level is not set, as follows:
if ( logger.isInfoEnabled() ) logger.info( "This " + methodCall() + " and the string " + "concatenation will only take place if " + "INFO debugging is currently enabled" );
A configuration file should be used by setting the
logger.config
system property which will be processed
using PropertyConfigurator.
Field Summary |
Fields inherited from interface com.opensymphony.provider.LogProvider |
DEBUG, ERROR, FATAL, INFO, WARN |
Constructor Summary | |
Log4JProvider()
|
Method Summary | |
void |
destroy()
Shutdown Provider. |
java.lang.Object |
getContext(java.lang.String name)
Get object representing context of logger. |
void |
init()
Setup Configurator. |
boolean |
isEnabled(java.lang.Object context,
int level)
Check whether logging is enabled for particular context/level combination. |
void |
log(java.lang.Object context,
int level,
java.lang.Object msg,
java.lang.Throwable throwable)
Log a message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Log4JProvider()
Method Detail |
public java.lang.Object getContext(java.lang.String name)
LogProvider
getContext
in interface LogProvider
public boolean isEnabled(java.lang.Object context, int level)
LogProvider
isEnabled
in interface LogProvider
public void destroy()
Provider
destroy
in interface Provider
public void init() throws ProviderConfigurationException
init
in interface Provider
ProviderConfigurationException
- thrown if error in startup
or configuration.public void log(java.lang.Object context, int level, java.lang.Object msg, java.lang.Throwable throwable)
LogProvider
log
in interface LogProvider
|
See www.opensymphony.com for more information. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |