greedy Flume appender

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

greedy Flume appender

Martin Bobák
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>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: greedy Flume appender

Ralph Goers
Your configuration below has 2 root loggers. There can only be one. From what you are describing it sounds like the first root logger is being ignored.

Ralph

> On Jun 20, 2017, at 10:12 AM, Martin Bobák <[hidden email]> wrote:
>
> 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>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: greedy Flume appender

Martin Bobák
Thanks Ralph,

copy&paste error. It is the same with one only one root logger .

Martin

On Tue, Jun 20, 2017 at 7:52 PM, Ralph Goers <[hidden email]>
wrote:

> Your configuration below has 2 root loggers. There can only be one. From
> what you are describing it sounds like the first root logger is being
> ignored.
>
> Ralph
>
> > On Jun 20, 2017, at 10:12 AM, Martin Bobák <[hidden email]>
> wrote:
> >
> > 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>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...