logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Bobák <martin.bo...@gmail.com>
Subject greedy Flume appender
Date Tue, 20 Jun 2017 17:12:54 GMT
Hello folks.

I'm using Tomcat 8.5.15 with log4j-2.8.2. I keep log4j2.xml [1] in
${catalina.home}/lib/. In this file I have several rolling file appenders
configured. Everything works fine until I add flume appender. All rolling
appender files have length 0 bytes and no data are written whatsoever after
adding flume appender. Will be glad for any help. Thanks.

Martin


1) my log4j2.xml :

<?xml version="1.0" encoding="utf-8"?>
<Configuration status="trace">
  <Properties>
    <Property name="logdir">${env:CARIDEN_ROOT}/logs/wae-web-server</
Property>
    <Property name="layout">%d{MM/dd HH:mm:ss.SSS} [%-5p][%t] %c{1}.%M() -
%m%n</Property>
  </Properties>
  <Appenders>
    <Console name="CONSOLE" target="SYSTEM_OUT">
      <PatternLayout pattern="${layout}"/>
    </Console>
    <RollingFile name="CATALINA"
        fileName="${logdir}/catalina.log"
        filePattern="${logdir}/catalina.%d{yyyy-MM-dd}-%i.log">
      <PatternLayout pattern="${layout}"/>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="25 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="10"/>
    </RollingFile>
    <RollingFile name="LOCALHOST"
        fileName="${logdir}/localhost.log"
        filePattern="${logdir}/localhost.%d{yyyy-MM-dd}-%i.log">
      <PatternLayout pattern="${layout}"/>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="25 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="10"/>
    </RollingFile>
    <RollingFile name="MANAGER"
        fileName="${logdir}/manager.log"
        filePattern="${logdir}/manager.%d{yyyy-MM-dd}-%i.log">
      <PatternLayout pattern="${layout}"/>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="25 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="10"/>
    </RollingFile>
    <RollingFile name="HOST-MANAGER"
        fileName="${logdir}/host-manager.log"
        filePattern="${logdir}/host-manager.%d{yyyy-MM-dd}-%i.log">
      <PatternLayout pattern="${layout}"/>
      <Policies>
        <TimeBasedTriggeringPolicy />
        <SizeBasedTriggeringPolicy size="25 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="10"/>
   </RollingFile>
    <Flume name="eventLogger" compress="false">
      <Agent host="127.0.0.1" port="7070"/>
      <PatternLayout pattern="WAE_WEB_SERVER | %d{ISO8601}{GMT} GMT | %p |
%t | %c.%M() | - | %m%n%throwable"/>
    </Flume>
  </Appenders>
  <Loggers>
    <Root level="info">
      <AppenderRef ref="CATALINA"/>
    </Root>
    <Logger name="org.apache.catalina.core.ContainerBase.[Catalina].
[localhost]"
        level="info" additivity="false">
      <AppenderRef ref="LOCALHOST"/>
    </Logger>
    <Logger name="org.apache.catalina.core.ContainerBase.[Catalina].
[localhost].[/manager]"
        level="info" additivity="false">
      <AppenderRef ref="MANAGER"/>
    </Logger>
    <Logger name="org.apache.catalina.core.ContainerBase.[Catalina].
[localhost].[/host-manager]"
        level="info" additivity="false">
      <AppenderRef ref="HOST-MANAGER"/>
    </Logger>
    <Root level="info">
        <AppenderRef ref="eventLogger"/>
    </Root>
  </Loggers>
</Configuration>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message