Permalink
Find file
c4868de Jan 24, 2012
@RobertStewart @pmonks @mickknutson
33 lines (28 sloc) 1.89 KB
# Set the root logger to
log4j.rootLogger=error, MongoDB
# MongoDB appender classname
# To log with a PatternLayout, use org.log4mongo.MongoDbPatternLayoutAppender
log4j.appender.MongoDB=org.log4mongo.MongoDbAppender
# MongoDB appender properties
# All are optional - defaults shown below (except for userName and password, which default to undefined)
# If using a replica set, set hostname to blank space-delimited list of host seeds. Don't include arbiters.
# Also, set port to either one port that all hosts will use or space-delimited list of one port per hostname
log4j.appender.MongoDB.hostname=localhost
log4j.appender.MongoDB.port=27017
log4j.appender.MongoDB.databaseName=log4mongo
log4j.appender.MongoDB.collectionName=log
log4j.appender.MongoDB.userName=open
log4j.appender.MongoDB.password=sesame
# The layout property is required only if the MongoDbPatternLayoutAppender appender is used.
# If a custom PatternParser and custom PatternConverters are required to log additional data,
# the specified layout class must extend MongoDbPatternLayout. A ConversionPattern property
# should also be specified.
#log4j.appender.MongoDB.layout=org.log4mongo.MongoDbPatternLayout
# The ConversionPattern property is required only if MongoDbPatternLayoutAppender is used.
# The pattern must be a valid JSON document. The value will typically contain one or more
# converter characters that are replaced when a message is logged. A key cannot begin with $,
# contain a . or be equal to _id due to BSON naming restrictions. The JSON document can have
# sub-documents. Values can be strings or arrays.
#log4j.appender.MongoDB.layout.ConversionPattern={"timestamp":"%d{yyyy-MM-dd'T'HH:mm:ss'Z'}","level":"%p","class":"%c{1}","message":"%m"}
# Add optional root level elements to each log event
#log4j.appender.MongoDB.rootLevelProperties=applicationName=MyProject&eventType=Development