|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.log4mongo.LoggingEventBsonifierImpl
public class LoggingEventBsonifierImpl
Default implementation class for creating a BSON representation of a Log4J LoggingEvent.
| Constructor Summary | |
|---|---|
LoggingEventBsonifierImpl()
|
|
| Method Summary | |
|---|---|
protected void |
addHostnameInformation(com.mongodb.DBObject bson)
Adds the current process's host name, VM name and IP address |
protected void |
addLocationInformation(com.mongodb.DBObject bson,
org.apache.log4j.spi.LocationInfo locationInfo)
Adds the LocationInfo object to an existing BSON object. |
protected void |
addMDCInformation(com.mongodb.DBObject bson,
java.util.Map<java.lang.Object,java.lang.Object> props)
Adds MDC Properties to the DBObject. |
protected void |
addThrowableInformation(com.mongodb.DBObject bson,
org.apache.log4j.spi.ThrowableInformation throwableInfo)
Adds the ThrowableInformation object to an existing BSON object. |
com.mongodb.DBObject |
bsonify(org.apache.log4j.spi.LoggingEvent loggingEvent)
BSONifies a single Log4J LoggingEvent object. |
protected com.mongodb.DBObject |
bsonifyClassName(java.lang.String className)
BSONifies the given class name. |
protected com.mongodb.DBObject |
bsonifyStackTrace(java.lang.StackTraceElement[] stackTrace)
BSONifies the given stack trace. |
protected com.mongodb.DBObject |
bsonifyStackTraceElement(java.lang.StackTraceElement element)
BSONifies the given stack trace element. |
protected com.mongodb.DBObject |
bsonifyThrowable(java.lang.Throwable throwable)
BSONifies the given Throwable. |
protected void |
nullSafePut(com.mongodb.DBObject bson,
java.lang.String key,
java.lang.Object value)
Adds the given value to the given key, except if it's null (in which case this method does nothing). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoggingEventBsonifierImpl()
| Method Detail |
|---|
public com.mongodb.DBObject bsonify(org.apache.log4j.spi.LoggingEvent loggingEvent)
bsonify in interface LoggingEventBsonifierloggingEvent - The LoggingEvent object to BSONify (may be null).
protected void addMDCInformation(com.mongodb.DBObject bson,
java.util.Map<java.lang.Object,java.lang.Object> props)
bson - The root DBObjectprops - MDC Properties to be logged
protected void addLocationInformation(com.mongodb.DBObject bson,
org.apache.log4j.spi.LocationInfo locationInfo)
bson - The BSON object to add the location info to (must not be null).locationInfo - The LocationInfo object to add to the BSON object (may be null).
protected void addThrowableInformation(com.mongodb.DBObject bson,
org.apache.log4j.spi.ThrowableInformation throwableInfo)
bson - The BSON object to add the throwable info to (must not be null).throwableInfo - The ThrowableInformation object to add to the BSON object (may be null).protected void addHostnameInformation(com.mongodb.DBObject bson)
bson - A BSON object containing host name, VM name and IP addressprotected com.mongodb.DBObject bsonifyThrowable(java.lang.Throwable throwable)
throwable - The throwable object to BSONify (may be null).
protected com.mongodb.DBObject bsonifyStackTrace(java.lang.StackTraceElement[] stackTrace)
stackTrace - The stack trace object to BSONify (may be null).
protected com.mongodb.DBObject bsonifyStackTraceElement(java.lang.StackTraceElement element)
element - The stack trace element object to BSONify (may be null).
protected com.mongodb.DBObject bsonifyClassName(java.lang.String className)
className - The class name to BSONify (may be null).
protected void nullSafePut(com.mongodb.DBObject bson,
java.lang.String key,
java.lang.Object value)
bson - The BSON object to add the key/value to (must not be null).key - The key of the object (must not be null).value - The value of the object (may be null).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||