forked from log4mongo/log4mongo-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlog4j.properties.sample
More file actions
27 lines (23 loc) · 1.58 KB
/
log4j.properties.sample
File metadata and controls
27 lines (23 loc) · 1.58 KB
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
# Set the root logger to
log4j.rootLogger=error, MongoDB
# MongoDB appender classname
# To log with a PatternLayout, use com.google.code.log4mongo.MongoDbPatternLayoutAppender
log4j.appender.MongoDB=com.google.code.log4mongo.MongoDbAppender
# MongoDB appender properties - all are optional - default values shown below (except for userName and password, which default to undefined)
log4j.appender.MongoDB.hostname=localhost
log4j.appender.MongoDB.port=27017
log4j.appender.MongoDB.databaseName=log4mongo
log4j.appender.MongoDB.collectionName=logevents
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=com.google.code.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"}