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 Inder Jeet Singh <in...@yahoo.co.in> on 2006/04/19 05:39:54 UTC

New file not getting created next day...DailyRollingFileAppender

Hi All
  I   have a doubt regarding log4j. Following is the explanantion:
     
    I am using log4j for logging. 
    I have   a set of 5-6 classes putting logs in their respective log files, not in the same   file. Out of those classes, I have two classes A and B putting logs in the same   log file. Now for both these classes I have seperate entries in the   configuration file regarding the appender(using DailyRollingFileAppender),   layout, date format etc.....but the same log file name..... It works fine   first...........but as the date changes, it is unable to change the file name   with previous date(as the format mentioned in the config file....) and have the   same file name for current date. What it does is, it just overrites the old file   content and start logging in the same file for current day's logs......and that   too the logs for two classes are coming in wrong way........First, all the logs   of class A are getting printed and then logs for class B are getting   printed....... 
     
    Could   anyone please help me in figuring out that what could be the problem and how can i   solve it?
  


Thanks & Regards
Inder Jeet Singh
				
---------------------------------
 Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

Re: New file not getting created next day...DailyRollingFileAppender

Posted by James Stauffer <st...@gmail.com>.
Can you post your configuration?

On 4/19/06, Inder Jeet Singh <in...@yahoo.co.in> wrote:
> Hi
>   Could you please tell me that how can i make them reference the same  appender in a case where i am using class specific configurations. How  those two classes can refere to the same appender in my case ?
>
> Curt Arnold <ca...@apache.org> wrote:
> On Apr 18, 2006, at 10:39 PM, Inder Jeet Singh wrote:
>
> > Hi All
> >   I   have a doubt regarding log4j. Following is the explanantion:
> >
> >     I am using log4j for logging.
> >     I have   a set of 5-6 classes putting logs in their respective
> > log files, not in the same   file. Out of those classes, I have two
> > classes A and B putting logs in the same   log file. Now for both
> > these classes I have seperate entries in the   configuration file
> > regarding the appender(using DailyRollingFileAppender),   layout,
> > date format etc.....but the same log file name..... It works fine
> > first...........but as the date changes, it is unable to change the
> > file name   with previous date(as the format mentioned in the
> > config file....) and have the   same file name for current date.
> > What it does is, it just overrites the old file   content and start
> > logging in the same file for current day's logs......and that   too
> > the logs for two classes are coming in wrong way........First, all
> > the logs   of class A are getting printed and then logs for class B
> > are getting   printed.......
> >
> >     Could   anyone please help me in figuring out that what could
> > be the problem and how can i   solve it?
> >
>
> Have them reference the same appender.  There is no attempt to detect
> that multiple appenders are attempting to write to the same file.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>
> Thanks & Regards
> Inder Jeet Singh
>
> ---------------------------------
>  Jiyo cricket on Yahoo! India cricket
> Yahoo! Messenger Mobile Stay in touch with your buddies all the time.
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: New file not getting created next day...DailyRollingFileAppender

Posted by Inder Jeet Singh <in...@yahoo.co.in>.
Hi
  Could you please tell me that how can i make them reference the same  appender in a case where i am using class specific configurations. How  those two classes can refere to the same appender in my case ?

Curt Arnold <ca...@apache.org> wrote:  
On Apr 18, 2006, at 10:39 PM, Inder Jeet Singh wrote:

> Hi All
>   I   have a doubt regarding log4j. Following is the explanantion:
>
>     I am using log4j for logging.
>     I have   a set of 5-6 classes putting logs in their respective  
> log files, not in the same   file. Out of those classes, I have two  
> classes A and B putting logs in the same   log file. Now for both  
> these classes I have seperate entries in the   configuration file  
> regarding the appender(using DailyRollingFileAppender),   layout,  
> date format etc.....but the same log file name..... It works fine    
> first...........but as the date changes, it is unable to change the  
> file name   with previous date(as the format mentioned in the  
> config file....) and have the   same file name for current date.  
> What it does is, it just overrites the old file   content and start  
> logging in the same file for current day's logs......and that   too  
> the logs for two classes are coming in wrong way........First, all  
> the logs   of class A are getting printed and then logs for class B  
> are getting   printed.......
>
>     Could   anyone please help me in figuring out that what could  
> be the problem and how can i   solve it?
>

Have them reference the same appender.  There is no attempt to detect  
that multiple appenders are attempting to write to the same file.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




Thanks & Regards
Inder Jeet Singh
				
---------------------------------
 Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

Re: New file not getting created next day...DailyRollingFileAppender

Posted by Curt Arnold <ca...@apache.org>.
On Apr 18, 2006, at 10:39 PM, Inder Jeet Singh wrote:

> Hi All
>   I   have a doubt regarding log4j. Following is the explanantion:
>
>     I am using log4j for logging.
>     I have   a set of 5-6 classes putting logs in their respective  
> log files, not in the same   file. Out of those classes, I have two  
> classes A and B putting logs in the same   log file. Now for both  
> these classes I have seperate entries in the   configuration file  
> regarding the appender(using DailyRollingFileAppender),   layout,  
> date format etc.....but the same log file name..... It works fine    
> first...........but as the date changes, it is unable to change the  
> file name   with previous date(as the format mentioned in the  
> config file....) and have the   same file name for current date.  
> What it does is, it just overrites the old file   content and start  
> logging in the same file for current day's logs......and that   too  
> the logs for two classes are coming in wrong way........First, all  
> the logs   of class A are getting printed and then logs for class B  
> are getting   printed.......
>
>     Could   anyone please help me in figuring out that what could  
> be the problem and how can i   solve it?
>

Have them reference the same appender.  There is no attempt to detect  
that multiple appenders are attempting to write to the same file.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org