You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mohit Anchlia <mo...@gmail.com> on 2014/08/08 00:16:36 UTC
Logging using log4j.xml 2
I have below xml but my application is not printing the logs to console. I
am running through eclipse and this file is in main/resources.
<?xml version=*"1.0"* encoding=*"UTF-8"*?>
<Configuration status=*"INFO"* monitorInterval=*"30"*>
<Appenders>
<Console name=*"Console"* target=*"SYSTEM_OUT"*>
<PatternLayout pattern=*"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
%msg%n"*/>
</Console>
</Appenders>
<Loggers>
<Root level=*"INFO"*>
<AppenderRef ref=*"Console"*/>
</Root>
</Loggers>
</Configuration>
Re: Logging using log4j.xml 2
Posted by Mohit Anchlia <mo...@gmail.com>.
I realized it later and changed it to log4j2.xml and now it works
On Thu, Aug 7, 2014 at 3:35 PM, Remko Popma <re...@gmail.com> wrote:
> The config file should be named log4j2.xml, not log4j.xml. Did you try
> that?
>
> Remko
>
> Sent from my iPhone
>
> > On 2014/08/08, at 7:16, Mohit Anchlia <mo...@gmail.com> wrote:
> >
> > I have below xml but my application is not printing the logs to console.
> I
> > am running through eclipse and this file is in main/resources.
> >
> > <?xml version=*"1.0"* encoding=*"UTF-8"*?>
> >
> > <Configuration status=*"INFO"* monitorInterval=*"30"*>
> >
> > <Appenders>
> >
> > <Console name=*"Console"* target=*"SYSTEM_OUT"*>
> >
> > <PatternLayout pattern=*"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
> > %msg%n"*/>
> >
> > </Console>
> >
> > </Appenders>
> >
> > <Loggers>
> >
> > <Root level=*"INFO"*>
> >
> > <AppenderRef ref=*"Console"*/>
> >
> > </Root>
> >
> > </Loggers>
> >
> > </Configuration>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
Re: Logging using log4j.xml 2
Posted by Remko Popma <re...@gmail.com>.
The config file should be named log4j2.xml, not log4j.xml. Did you try that?
Remko
Sent from my iPhone
> On 2014/08/08, at 7:16, Mohit Anchlia <mo...@gmail.com> wrote:
>
> I have below xml but my application is not printing the logs to console. I
> am running through eclipse and this file is in main/resources.
>
> <?xml version=*"1.0"* encoding=*"UTF-8"*?>
>
> <Configuration status=*"INFO"* monitorInterval=*"30"*>
>
> <Appenders>
>
> <Console name=*"Console"* target=*"SYSTEM_OUT"*>
>
> <PatternLayout pattern=*"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
> %msg%n"*/>
>
> </Console>
>
> </Appenders>
>
> <Loggers>
>
> <Root level=*"INFO"*>
>
> <AppenderRef ref=*"Console"*/>
>
> </Root>
>
> </Loggers>
>
> </Configuration>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: Logging using log4j.xml 2
Posted by Matt Sicker <bo...@gmail.com>.
Are you naming the file log4j2.xml?
On 7 August 2014 17:16, Mohit Anchlia <mo...@gmail.com> wrote:
> I have below xml but my application is not printing the logs to console. I
> am running through eclipse and this file is in main/resources.
>
> <?xml version=*"1.0"* encoding=*"UTF-8"*?>
>
> <Configuration status=*"INFO"* monitorInterval=*"30"*>
>
> <Appenders>
>
> <Console name=*"Console"* target=*"SYSTEM_OUT"*>
>
> <PatternLayout pattern=*"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
> %msg%n"*/>
>
> </Console>
>
> </Appenders>
>
> <Loggers>
>
> <Root level=*"INFO"*>
>
> <AppenderRef ref=*"Console"*/>
>
> </Root>
>
> </Loggers>
>
> </Configuration>
>
--
Matt Sicker <bo...@gmail.com>