logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sujatha rdn <sujatha...@wavecrest.gi>
Subject RE: Issue with configuration status and Rolling Files
Date Tue, 07 Oct 2014 08:46:27 GMT
Yes. I am using the following list of jars in my webapp.

log4j-api-2.0.jar
log4j-slf4j-impl-2.0.jar ( as I am using slf4j as a interface in my
application to connect to log4j2)
log4j-core-2.0.jar
log4j-web-2.0.jar

Here is my log4j2.xml and web.xml as well.

I have added a new log file in the log4j2.xml and then restarted my tomcat.
It doesn’t create the new log file after successful start up of tomcat ( it
only created the previous log files in the specified folder)

Hence, I added the log4j2 configuration in JAVA_OPTS
(-Dlog4j.configurationFile=file:///etc/config/xml/log4j2.xml) and restarted
the tomcat. Now it created all the log files successfully and writes to
files, but after some it wipes out.

Log4j2 had created all the following log files and Analytics.log and
APIRequestResponse.log is updated too.
-rw-rw-r-- 1 wcuser wcuser    0 Oct  7 13:49 UserActivity.log
-rw-rw-r-- 1 wcuser wcuser    0 Oct  7 13:49 Analytics_admin.log
-rw-rw-r-- 1 wcuser wcuser    0 Oct  7 13:49 ruleAnalytics.log
-rw-rw-r-- 1 wcuser wcuser  963 Oct  7 13:50 APIRequestResponse.log
-rw-rw-r-- 1 wcuser wcuser 7079 Oct  7 13:50 Analytics.log

But after some time , my Analytics.log goes to oKB.
-rw-rw-r-- 1 wcuser wcuser   0 Oct  7 13:49 UserActivity.log
-rw-rw-r-- 1 wcuser wcuser   0 Oct  7 13:49 Analytics_admin.log
-rw-rw-r-- 1 wcuser wcuser   0 Oct  7 13:49 ruleAnalytics.log
-rw-rw-r-- 1 wcuser wcuser 963 Oct  7 13:50 APIRequestResponse.log
-rw-rw-r-- 1 wcuser wcuser   0 Oct  7 13:52 Analytics.log

Am I doing something wrong in the configuration??

-----Original Message-----
From: Matt Sicker [mailto:boards@gmail.com]
Sent: Monday, October 06, 2014 8:32 PM
To: Log4J Users List
Subject: Re: Issue with configuration status and Rolling Files

Are you using log4j-web? Also, are you looking for Tomcat's logs to come
from Log4j as well? Because that isn't possible without a JUL adapter (which
Log4j 2.1 will have).

On 6 October 2014 04:02, sujatha rdn <sujathardn@wavecrest.gi> wrote:

> Yup.
>
> Herewith attaching the configuration file.
>
> And also, in my application, I will be accessing in the following way.
>
> Public class Logger{
> private static final org.slf4j.Logger slfLogger=
> LoggerFactory.getLogger("webAnalyticLog");
> private static final org.slf4j.Logger adminSlfLogger=
> LoggerFactory.getLogger("adminAnalyticLog");
>
> if(info.getServiceType() == ADMIN){
>                         adminSlfLogger.info(message);
>                 }else{
>                         slfLogger.info(message);                }
> }
>
> -----Original Message-----
> From: Harinath Mallepally [mailto:harinath@careerscale.in]
> Sent: Monday, October 06, 2014 2:22 PM
> To: Log4J Users List
> Subject: Re: Issue with configuration status and Rolling Files
>
> share the configuration file.
>
>
>
> Thanks
> Harinath Mallepally
> harinath@careerscale.in
> Careerscale IT Consulting LLP
> +91 9391920444 / 040-42100276
> Hyderabad
>
> On Mon, Oct 6, 2014 at 2:17 PM, sujatha rdn <sujathardn@wavecrest.gi>
> wrote:
>
> > Hi,
> >
> >
> >
> > I have migrated to log4j2 with slf4j adapter. But I am facing some
> issues.
> >
> >
> >
> > 1.       When I add configuration status <configuration status=”trace”>
> > I
> > don’t see any logs related to log4j in my catalina logs
> >
> > 2.       And also, I have 5 loggers mapped to 5 different rolling files.
> > But only 4 files get created in the specified location and in that
> > only one files gets updated with the logs.
> >
> >
> >
> > Here are some details that you want to know before you suggest me a
> > solution.
> >
> > 1.       I am working on servlet 2.5 web application and our container
> > is
> > tomcat 7.
> >
> > 2.       I am using slf4j adapter as interface in my application to
> access
> > log4j2
> >
> >
> >
> > Do please let me know if you need any further details to help me out.
> >
> >
> >
> >
> >
> > Thanks,
> >
> > Sujatha
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>



--
Matt Sicker <boards@gmail.com>

Mime
View raw message