Spring Data Document

org.springframework.data.mongodb.log4j
Class MongoLog4jAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.springframework.data.mongodb.log4j.MongoLog4jAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class MongoLog4jAppender
extends org.apache.log4j.AppenderSkeleton

Author:
Jon Brisbin <[email protected]>

Field Summary
static String APP_ID
           
protected  String applicationId
           
protected  org.apache.log4j.PatternLayout collectionLayout
           
protected  String collectionPattern
           
protected  String database
           
static String DAY
           
protected  DB db
           
protected  String host
           
static String HOUR
           
protected  WriteConcern infoOrLowerWriteConcern
           
static String LEVEL
           
static String MESSAGE
           
protected  Mongo mongo
           
static String MONTH
           
static String NAME
           
protected  int port
           
static String PROPERTIES
           
static String TIMESTAMP
           
static String TRACEBACK
           
protected  WriteConcern warnOrHigherWriteConcern
           
static String YEAR
           
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
MongoLog4jAppender()
           
MongoLog4jAppender(boolean isActive)
           
 
Method Summary
protected  void append(org.apache.log4j.spi.LoggingEvent event)
           
 void close()
           
protected  void connectToMongo()
           
 String getApplicationId()
           
 String getCollectionPattern()
           
 String getDatabase()
           
 String getHost()
           
 String getInfoOrLowerWriteConcern()
           
 int getPort()
           
 String getWarnOrHigherWriteConcern()
           
 boolean requiresLayout()
           
 void setApplicationId(String applicationId)
           
 void setCollectionPattern(String collectionPattern)
           
 void setDatabase(String database)
           
 void setHost(String host)
           
 void setInfoOrLowerWriteConcern(String wc)
           
 void setPort(int port)
           
 void setWarnOrHigherWriteConcern(String wc)
           
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL

public static final String LEVEL
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

APP_ID

public static final String APP_ID
See Also:
Constant Field Values

TIMESTAMP

public static final String TIMESTAMP
See Also:
Constant Field Values

PROPERTIES

public static final String PROPERTIES
See Also:
Constant Field Values

TRACEBACK

public static final String TRACEBACK
See Also:
Constant Field Values

MESSAGE

public static final String MESSAGE
See Also:
Constant Field Values

YEAR

public static final String YEAR
See Also:
Constant Field Values

MONTH

public static final String MONTH
See Also:
Constant Field Values

DAY

public static final String DAY
See Also:
Constant Field Values

HOUR

public static final String HOUR
See Also:
Constant Field Values

host

protected String host

port

protected int port

database

protected String database

collectionPattern

protected String collectionPattern

collectionLayout

protected org.apache.log4j.PatternLayout collectionLayout

applicationId

protected String applicationId

warnOrHigherWriteConcern

protected WriteConcern warnOrHigherWriteConcern

infoOrLowerWriteConcern

protected WriteConcern infoOrLowerWriteConcern

mongo

protected Mongo mongo

db

protected DB db
Constructor Detail

MongoLog4jAppender

public MongoLog4jAppender()

MongoLog4jAppender

public MongoLog4jAppender(boolean isActive)
Method Detail

getHost

public String getHost()

setHost

public void setHost(String host)

getPort

public int getPort()

setPort

public void setPort(int port)

getDatabase

public String getDatabase()

setDatabase

public void setDatabase(String database)

getCollectionPattern

public String getCollectionPattern()

setCollectionPattern

public void setCollectionPattern(String collectionPattern)

getApplicationId

public String getApplicationId()

setApplicationId

public void setApplicationId(String applicationId)

setWarnOrHigherWriteConcern

public void setWarnOrHigherWriteConcern(String wc)

getWarnOrHigherWriteConcern

public String getWarnOrHigherWriteConcern()

getInfoOrLowerWriteConcern

public String getInfoOrLowerWriteConcern()

setInfoOrLowerWriteConcern

public void setInfoOrLowerWriteConcern(String wc)

connectToMongo

protected void connectToMongo()
                       throws UnknownHostException
Throws:
UnknownHostException

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Specified by:
append in class org.apache.log4j.AppenderSkeleton

close

public void close()

requiresLayout

public boolean requiresLayout()

Spring Data Document

Copyright © 2012. All Rights Reserved.