Logback API
Version 0.9.8

ch.qos.logback.access
Class PatternLayout

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.LayoutBase<E>
          extended by ch.qos.logback.core.pattern.PatternLayoutBase<AccessEvent>
              extended by ch.qos.logback.access.PatternLayout
All Implemented Interfaces:
Layout<AccessEvent>, ContextAware, LifeCycle

public class PatternLayout
extends PatternLayoutBase<AccessEvent>

This class is a module-specific implementation of PatternLayout to allow http-specific patterns to be used. The ch.qos.logback.access.PatternLayout provides a way to format the logging output that is just as easy and flexible as the usual PatternLayout.

For more information about this layout, please refer to the online manual at http://logback.qos.ch/manual/layouts.html#AccessPatternLayout

Author:
Ceki Gülcü, Sébastien Pennec

Field Summary
static String CLF_PATTERN
           
static String CLF_PATTERN_NAME
           
static String CLF_PATTERN_NAME_2
           
static String COMBINED_PATTERN
           
static String COMBINED_PATTERN_NAME
           
static Map<String,String> defaultConverterMap
           
 
Fields inherited from class ch.qos.logback.core.LayoutBase
started
 
Fields inherited from interface ch.qos.logback.core.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
PatternLayout()
           
 
Method Summary
 String doLayout(AccessEvent event)
          Transform an event (of type Object) and return it as a String after appropriate formatting.
 Map<String,String> getDefaultConverterMap()
          Returns the default converter map for this instance.
protected  void postCompileProcessing(Converter<AccessEvent> head)
          Add a line separator so that each line is on a separate line.
 void start()
           
 
Methods inherited from class ch.qos.logback.core.pattern.PatternLayoutBase
findTail, getEffectiveConverterMap, getInstanceConverterMap, getPattern, setContextForConverters, setPattern, toString, writeLoopOnConverters
 
Methods inherited from class ch.qos.logback.core.LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getStatusManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn
 

Field Detail

defaultConverterMap

public static final Map<String,String> defaultConverterMap

CLF_PATTERN

public static String CLF_PATTERN

CLF_PATTERN_NAME

public static String CLF_PATTERN_NAME

CLF_PATTERN_NAME_2

public static String CLF_PATTERN_NAME_2

COMBINED_PATTERN

public static String COMBINED_PATTERN

COMBINED_PATTERN_NAME

public static String COMBINED_PATTERN_NAME
Constructor Detail

PatternLayout

public PatternLayout()
Method Detail

getDefaultConverterMap

public Map<String,String> getDefaultConverterMap()
Returns the default converter map for this instance.

Specified by:
getDefaultConverterMap in class PatternLayoutBase<AccessEvent>
Returns:
A map associating pattern words to the names of converter classes

postCompileProcessing

protected void postCompileProcessing(Converter<AccessEvent> head)
Add a line separator so that each line is on a separate line.

Overrides:
postCompileProcessing in class PatternLayoutBase<AccessEvent>

doLayout

public String doLayout(AccessEvent event)
Description copied from interface: Layout
Transform an event (of type Object) and return it as a String after appropriate formatting.

Taking in an object and returning a String is the least sophisticated way of formatting events. However, it is remarkably CPU-effective.

Parameters:
event - The event to format
Returns:
the event formatted as a String

start

public void start()
Specified by:
start in interface LifeCycle
Overrides:
start in class PatternLayoutBase<AccessEvent>

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.