net.logstash.log4j
Class JSONEventLayoutV1

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by net.logstash.log4j.JSONEventLayoutV1
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class JSONEventLayoutV1
extends org.apache.log4j.Layout


Field Summary
static String ADDITIONAL_DATA_PROPERTY
           
static org.apache.commons.lang.time.FastDateFormat ISO_DATETIME_TIME_ZONE_FORMAT_WITH_MILLIS
           
static TimeZone UTC
           
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
JSONEventLayoutV1()
          For backwards compatibility, the default is to generate location information in the log messages.
JSONEventLayoutV1(boolean locationInfo)
          Creates a layout that optionally inserts location information into log messages.
 
Method Summary
 void activateOptions()
           
static String dateFormat(long timestamp)
           
 String format(org.apache.log4j.spi.LoggingEvent loggingEvent)
           
 boolean getLocationInfo()
          Query whether log messages include location information.
 String getUserFields()
           
 boolean ignoresThrowable()
           
 void setLocationInfo(boolean locationInfo)
          Set whether log messages should include location information.
 void setUserFields(String userFields)
           
 
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
 

Field Detail

UTC

public static final TimeZone UTC

ISO_DATETIME_TIME_ZONE_FORMAT_WITH_MILLIS

public static final org.apache.commons.lang.time.FastDateFormat ISO_DATETIME_TIME_ZONE_FORMAT_WITH_MILLIS

ADDITIONAL_DATA_PROPERTY

public static final String ADDITIONAL_DATA_PROPERTY
See Also:
Constant Field Values
Constructor Detail

JSONEventLayoutV1

public JSONEventLayoutV1()
For backwards compatibility, the default is to generate location information in the log messages.


JSONEventLayoutV1

public JSONEventLayoutV1(boolean locationInfo)
Creates a layout that optionally inserts location information into log messages.

Parameters:
locationInfo - whether or not to include location information in the log messages.
Method Detail

dateFormat

public static String dateFormat(long timestamp)

format

public String format(org.apache.log4j.spi.LoggingEvent loggingEvent)
Specified by:
format in class org.apache.log4j.Layout

ignoresThrowable

public boolean ignoresThrowable()
Specified by:
ignoresThrowable in class org.apache.log4j.Layout

getLocationInfo

public boolean getLocationInfo()
Query whether log messages include location information.

Returns:
true if location information is included in log messages, false otherwise.

setLocationInfo

public void setLocationInfo(boolean locationInfo)
Set whether log messages should include location information.

Parameters:
locationInfo - true if location information should be included, false otherwise.

getUserFields

public String getUserFields()

setUserFields

public void setUserFields(String userFields)

activateOptions

public void activateOptions()


Copyright © 2014. All Rights Reserved.