forked from RobertStewart/log4mongo-java
-
Notifications
You must be signed in to change notification settings - Fork 29
/
log4j.properties.sample
33 lines (28 loc) · 1.89 KB
/
log4j.properties.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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