diff --git a/mongodb/README.md b/mongodb/README.md index 81a0eb5737529aea518e2bac60c60e4f9079ac21..b24814517b704a9ee00fee82eabaa86fb1c02ec1 100644 --- a/mongodb/README.md +++ b/mongodb/README.md @@ -1,5 +1,5 @@ <!-- -Copyright (c) 2012 - 2015 YCSB contributors. All rights reserved. +Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You @@ -92,6 +92,13 @@ Then, run the workload: See the next section for the list of configuration parameters for MongoDB. +## Log Level Control +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: + +``` +bin/ycsb run mongodb -jvm-args="-Dlogback.configurationFile=/path/to/logback.xml" +``` + ## MongoDB Configuration Parameters - `mongodb.url` diff --git a/mongodb/src/main/resources/logback.xml b/mongodb/src/main/resources/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..dfbfeb2b994163a37e56c30526ed0b6b811ffb23 --- /dev/null +++ b/mongodb/src/main/resources/logback.xml @@ -0,0 +1,32 @@ +<!-- +Copyright (c) 2016 YCSB contributors. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); you +may not use this file except in compliance with the License. You +may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing +permissions and limitations under the License. See accompanying +LICENSE file. +--> +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> + </encoder> + </appender> + + <logger name="org.mongodb" level="WARN"> + <appender-ref ref="STDOUT"/> + </logger> + + <root level="INFO"> + <appender-ref ref="STDOUT"/> + </root> +</configuration>