com.norconex.jef.log
Class ThreadSafeLayout

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by com.norconex.jef.log.ThreadSafeLayout
All Implemented Interfaces:
OptionHandler

public class ThreadSafeLayout
extends Layout

Log layout decorator, prefixing any existing layout with the job id associated with the current thread, separated with colon-space (": "). If no jobs are associated with a given log event, the prefix "[non-job]: " will get prepended.

Author:
Pascal Essiembre
See Also:
FileLogManager

Field Summary
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
ThreadSafeLayout(Layout layout)
          Constructor.
 
Method Summary
 void activateOptions()
           
 String format(LoggingEvent evt)
          Calls the decorated instance, prefixing with job identifier.
 boolean ignoresThrowable()
           
 
Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadSafeLayout

public ThreadSafeLayout(Layout layout)
Constructor.

Parameters:
layout - decorated layout
Method Detail

activateOptions

public void activateOptions()

format

public String format(LoggingEvent evt)
Calls the decorated instance, prefixing with job identifier.

Specified by:
format in class Layout
See Also:
Layout.format(org.apache.log4j.spi.LoggingEvent)

ignoresThrowable

public boolean ignoresThrowable()
Specified by:
ignoresThrowable in class Layout


Copyright © 2007-2013 Norconex Inc.. All Rights Reserved.