logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: All log4j appenders defined in log4j.properties in play
Date Fri, 11 Jul 2014 13:06:56 GMT
Check out the additivity setting. Plus, check out Log4j 2.0 as that's what
we're all focused on right now!


On 11 July 2014 01:01, Vishal Pore <pore.vishal@gmail.com> wrote:

> My log4j.properties file is pasted below. My understanding is that we need
> to add Appenders to the *root *logger for the appender to work. As you can
> see in the below properties file, only appender A is attached to the root
> logger (log4j.rootLogger=info, A). However, what I see is that the logging
> information is printed to both the appenders (ConsoleAppender - A and File
> Appender - B). How is this possible?
>
> log4j.rootLogger=info, A
> log4j.appender.A=org.apache.log4j.ConsoleAppender
> log4j.appender.A.layout=org.apache.log4j.PatternLayout
> log4j.appender.A.layout.ConversionPattern=%-4r [%t] [rid=%X{RID} ]
> %-5p %c %x - %m%n
>
> log4j.appender.B=org.apache.log4j.FileAppender
> log4j.appender.B.layout=org.apache.log4j.PatternLayout
> log4j.appender.B.file=target/server.log
> log4j.appender.B.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
>
> I have posted the same question on
>
> stackoverflow-link
> <
> http://stackoverflow.com/questions/24679226/all-log4j-appenders-defined-in-log4j-properties-in-play
> >
>
>  and failed to get any responses. Any resposes appreciated.
>
>
> Regards,
>
>
> Vishal Pore
>



-- 
Matt Sicker <boards@gmail.com>

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