[英]log4j2 logger levels not working
I am using log4j2 with below configuration. 我使用以下配置的log4j2。 The logger "org.apache.solr" is defined with level="info", but i can see error messages also in the log file.
记录器“ org.apache.solr”是用level =“ info”定义的,但是我也可以在日志文件中看到错误消息。 What i am trying to ensure is that only info level logs for package "org.apache.solr.*" are sent to flume and remainder are logged to the tomcat.log.
我要确保的是仅将软件包“ org.apache.solr。*”的信息级别日志发送到水槽,其余信息记录到tomcat.log。
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration status="INFO">
<Appenders>
<RollingRandomAccessFile name="tomcatLog" fileName="/home/jim/logs/tomcat.log" filePattern="/home/jim/logs/$${date:yyyy-MM}/tomcat-%d{yyyy-MM-dd-HH}-%i.log.gz">
<PatternLayout>
<Pattern>%d{dd MMM yyyy HH:mm:ss,SSS} %t %p %c{1.} [%F - %L] %m%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="6" modulate="true"/>
<SizeBasedTriggeringPolicy size="250 MB"/>
</Policies>
</RollingRandomAccessFile>
<Flume name="solrEventLogger" compress="false">
<Property name="channel.type">file</Property>
<Property name="channel.checkpointDir">/home/jim/logs/solr/checkpoint</Property>
<Property name="channel.dataDirs">/home/jim/logs/solr/data</Property>
<Property name="sinks">agent1</Property>
<Property name="agent1.channel">file</Property>
<Property name="agent1.type">avro</Property>
<Property name="agent1.hostname">127.0.0.1</Property>
<Property name="agent1.port">61237</Property>
<Property name="agent1.batch-size">1</Property>
<PatternLayout>
<Pattern>%d{dd MMM yyyy HH:mm:ss,SSS} %t %p %c{1.} [%F - %L] %m%n</Pattern>
</PatternLayout>
<Property name="processor.type">failover</Property>
</Flume>
</Appenders>
<Loggers>
<Logger name="org.apache.solr" additivity="true" level="info">
<AppenderRef ref="solrEventLogger" />
</Logger>
<Root level="warn">
<AppenderRef ref="tomcatLog"/>
</Root>
</Loggers>
</Configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.