You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Nikolaos Tsipas (JIRA)" <ji...@apache.org> on 2014/05/16 13:20:17 UTC

[jira] [Commented] (FLUME-2387) Flume log4j appender stacktrace handling

    [ https://issues.apache.org/jira/browse/FLUME-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13999713#comment-13999713 ] 

Nikolaos Tsipas commented on FLUME-2387:
----------------------------------------

It looks like this is controlled by the log4j layout used and what ignoresThrowable() returns.

> Flume log4j appender stacktrace handling
> ----------------------------------------
>
>                 Key: FLUME-2387
>                 URL: https://issues.apache.org/jira/browse/FLUME-2387
>             Project: Flume
>          Issue Type: Bug
>          Components: Sinks+Sources
>    Affects Versions: v1.4.0
>         Environment: centos 6
>            Reporter: Nikolaos Tsipas
>              Labels: appender, log4j, log4jappender, stacktrace
>
> Hello,
> I'm using log4j flume appender in a tomcat webapp to send log lines to a flume avro source. Everything seems to work fine for "normal" log lines however calls like:
> {code}
> logger.error("Exception: ", e); 
> {code}
> seem to ignore the stacktrace (throwable) so the only thing I get on the other side is the "Exception: " string. I tried the same code with console and file log4j appenders and the stacktraces are printed properly.
> I would appreciate any ideas/suggestion about why I can't get them with the flume log4j appender?
> I've noticed that both console and file appenders are extending {{org.apache.log4j.WriterAppender->org.apache.log4j.AppenderSkeleton}} while flume appender extends {{org.apache.log4j.AppenderSkeleton}} only. 
> This is my log4j.xml
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
>     <!-- Appenders -->
>     <appender name="console" class="org.apache.log4j.ConsoleAppender">
>         <param name="Target" value="System.out" />
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n" />
>         </layout>
>     </appender>
>     
>     <appender name="flume"       class="org.apache.flume.clients.log4jappender.Log4jAppender">
>              <param name="Hostname" value="localhost"/>
>              <param name="Port" value="4545"/>
>              <param name="UnsafeMode" value="true"/>
>         <layout class="org.apache.log4j.PatternLayout">
>           <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
>         </layout>
>     </appender>
>     
>     <appender name="file" class="org.apache.log4j.FileAppender">
>         <param name="File" value="/tmp/util.log" />
>         <param name="Append" value="true" />
>         <layout class="org.apache.log4j.PatternLayout">
>           <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
>         </layout>
>      </appender>
>     
>     <!-- Root Logger -->
>     <root>
>         <priority value ="info" />
>         <appender-ref ref="console" />
>         <appender-ref ref="flume" />
>         <appender-ref ref="file" />
>     </root>
>     
> </log4j:configuration>
> {code}
> Thank you!
> Nick



--
This message was sent by Atlassian JIRA
(v6.2#6252)