hbase/conf/log4j2.xml

105 lines
4.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
-->
<Configuration>
<Appenders>
<!-- Console appender -->
<Console name="console" target="SYSTEM_ERR">
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
</Console>
<!-- Daily Rolling File Appender -->
<RollingFile name="DRFA"
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%d{yyyy-MM-dd}">
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
<Policies>
<TimeBasedTriggeringPolicy interval="1" />
</Policies>
<DefaultRolloverStrategy max="30" />
</RollingFile>
<!-- Rolling File Appender -->
<RollingFile name="RFA"
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}"
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.log.file:-hbase.log}.%i">
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="256MB" />
</Policies>
<DefaultRolloverStrategy max="20" />
</RollingFile>
<!-- Security audit appender -->
<RollingFile name="RFAS"
fileName="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}"
filePattern="${sys:hbase.log.dir:-.}/${sys:hbase.security.log.file:-SecurityAuth.audit}.%i">
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="256MB" />
</Policies>
<DefaultRolloverStrategy max="20" />
</RollingFile>
<!--
Http Access Log RFA, uncomment this if you want an http access.log
<RollingFile name="AccessRFA"
fileName="/var/log/hbase/access.log"
filePattern="/var/log/hbase/access.log.%i">
<PatternLayout pattern="%m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="200MB" />
</Policies>
<DefaultRolloverStrategy max="10" />
</RollingFile>
-->
<Null name="NullAppender" />
</Appenders>
<Loggers>
<Root level="${sys:hbase.root.logger.level:-info}">
<AppenderRef ref="${sys:hbase.root.logger.appender:-console}" />
</Root>
<Logger name="SecurityLogger" level="${sys:hbase.security.logger.level:-info}"
additivity="false">
<AppenderRef ref="${sys:hbase.security.logger.appender:-console}" />
</Logger>
<!-- Custom Logging levels -->
<!--
<Logger name="org.apache.zookeeper" level="debug"/>
<Logger name="org.apache.hadoop.fs.FSNamesystem" level="debug"/>
<Logger name="org.apache.hadoop.hbase" level="debug"/>
<Logger name="org.apache.hadoop.hbase.META" level="debug"/>
Make these two classes below DEBUG to see more zk debug.
<Logger name="org.apache.hadoop.hbase.zookeeper.ZKUtil" level="debug"/>
<Logger name="org.apache.hadoop.hbase.zookeeper.ZKWatcher" level="debug"/>
<Logger name="org.apache.hadoop.dfs" level="debug"/>
-->
<!-- Prevent metrics subsystem start/stop messages (HBASE-17722) -->
<Logger name="org.apache.hadoop.metrics2.impl.MetricsConfig" level="warn" />
<Logger name="org.apache.hadoop.metrics2.impl.MetricsSinkAdapter" level="warn" />
<Logger name="org.apache.hadoop.metrics2.impl.MetricsSystemImpl" level="warn" />
<!-- Disable request log by default, you can enable this by changing the appender -->
<Logger name="http.requests" level="info" additivity="false">
<AppenderRef ref="NullAppender" />
</Logger>
<!--
Replace the above with this configuration if you want an http access.log
<Logger name="http.requests" level="info" additivity="false">
<AppenderRef ref="AccessRFA" />
</Logger>
-->
</Loggers>
</Configuration>