PTLog API - 1.0

jp.ne.dti.lares.foozy.ptlog.log4j
Class Log4jLogContext

java.lang.Object
  extended byjp.ne.dti.lares.foozy.ptlog.log4j.Log4jLogContext
All Implemented Interfaces:
LogContext

public class Log4jLogContext
extends java.lang.Object
implements LogContext

Implementation for Log4jProvider.

See Also:
Log4jProvider

Constructor Summary
Log4jLogContext(org.apache.log4j.Logger logger)
          Constructor.
 
Method Summary
 boolean enables(LogType type, java.lang.String method)
          Delegate request to Logger of Log4j.
 java.lang.String getSubject(boolean embedded)
          Return subject name of logging request.
 void log(LogType type, java.lang.String method, java.lang.String message, java.lang.Throwable throwable)
          Delegate request to Logger of Log4j.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jLogContext

public Log4jLogContext(org.apache.log4j.Logger logger)
Constructor.

Parameters:
logger - Log4j specific context object
Method Detail

getSubject

public java.lang.String getSubject(boolean embedded)
Return subject name of logging request.

Specified by:
getSubject in interface LogContext
Parameters:
embedded - whether returned value is embedded in message or not.
Returns:
name of logging request subject

enables

public boolean enables(LogType type,
                       java.lang.String method)
Delegate request to Logger of Log4j.

Specified by:
enables in interface LogContext
Parameters:
type - of log record.
method - from which logging request is invoked.
Returns:
true if logging is enabled for such context.

log

public void log(LogType type,
                java.lang.String method,
                java.lang.String message,
                java.lang.Throwable throwable)
Delegate request to Logger of Log4j.

Specified by:
log in interface LogContext
Parameters:
type - of logging
method - from which logging is requested
message - of logging
throwable - of logging

PTLog API - 1.0