Skip to content

Commit 5213b9b

Browse files
committed
[mongodb] added logback.xml to mongodb module
1 parent 0231606 commit 5213b9b

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

mongodb/README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright (c) 2012 - 2015 YCSB contributors. All rights reserved.
2+
Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved.
33
44
Licensed under the Apache License, Version 2.0 (the "License"); you
55
may not use this file except in compliance with the License. You
@@ -92,6 +92,13 @@ Then, run the workload:
9292

9393
See the next section for the list of configuration parameters for MongoDB.
9494

95+
## Log Level Control
96+
Due to the mongodb driver defaulting to a log level of DEBUG, a logback.xml file is included with this module that restricts the org.mongodb logging to WARN. You can control this by overriding the logback.xml and defining it in your ycsb command by adding this flag:
97+
98+
```
99+
bin/ycsb run mongodb -jvm-args="-Dlogback.configurationFile=/path/to/logback.xml"
100+
```
101+
95102
## MongoDB Configuration Parameters
96103

97104
- `mongodb.url`
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
Copyright (c) 2016 YCSB contributors. All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License"); you
5+
may not use this file except in compliance with the License. You
6+
may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13+
implied. See the License for the specific language governing
14+
permissions and limitations under the License. See accompanying
15+
LICENSE file.
16+
-->
17+
<?xml version="1.0" encoding="UTF-8"?>
18+
<configuration>
19+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
20+
<encoder>
21+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
22+
</encoder>
23+
</appender>
24+
25+
<logger name="org.mongodb" level="WARN">
26+
<appender-ref ref="STDOUT"/>
27+
</logger>
28+
29+
<root level="INFO">
30+
<appender-ref ref="STDOUT"/>
31+
</root>
32+
</configuration>

0 commit comments

Comments
 (0)