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 Kailash KN <ka...@thbs.com> on 2006/04/18 13:29:14 UTC

Format of LOG File!!!

Hi log4j team,

       I'm new to log4j and jus trying to get a hands on experience on it. I have 2 queries as of now...
a) Can i have different files to write the log messages, like a debug file for DEBUG log, INFO file for INFO log, and so on.

b) i want my log file to have the format "yyyy-MM-dd-debug.log","yyyy-MM-dd-error.log", "yyyy-MM-dd-info.log", and so on. In the sense i want it to roll-over at midnight!!! Can i have it that way. I had a look at the Appenders, but its appending at the end, i want it in the beginning. 

Thanks & Regards,
Kailash.K.N.
# 71, 4th Floor,
Sona Towers, Miller's Road,
Bangalore - 560 052
email : kailash_kn@yahoo.com
Ph : +91-9886634958

Re: Format of LOG File!!!

Posted by James Stauffer <st...@gmail.com>.
The easiest way to to look at one of the current appenders as an
example.  You probably want to look at DailyRollingFileAppender.

On 4/18/06, Kailash KN <ka...@thbs.com> wrote:
> could you just gimme a hint as to how to write the Appender, i'm not able to
> figure it out!!! :-(
>
> Thanks & Regards,
> Kailash.K.N.
> # 71, 4th Floor,
> Sona Towers, Miller's Road,
> Bangalore - 560 052
> email : kailash_kn@yahoo.com
> Ph : +91-9886634958

--
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: Format of LOG File!!!

Posted by Kailash KN <ka...@thbs.com>.
could you just gimme a hint as to how to write the Appender, i'm not able to 
figure it out!!! :-(

Thanks & Regards,
Kailash.K.N.
# 71, 4th Floor,
Sona Towers, Miller's Road,
Bangalore - 560 052
email : kailash_kn@yahoo.com
Ph : +91-9886634958

----- Original Message ----- 
From: "James Stauffer" <st...@gmail.com>
To: "Log4J Users List" <lo...@logging.apache.org>
Sent: Tuesday, April 18, 2006 9:00 PM
Subject: Re: Format of LOG File!!!


a) Yes.

b) I think you would have to write your own appender to get that
format.  I wrote an appender that could handle that.

On 4/18/06, Kailash KN <ka...@thbs.com> wrote:
>
>
> Hi log4j team,
>
>        I'm new to log4j and jus trying to get a hands on experience on it. 
> I
> have 2 queries as of now...
> a) Can i have different files to write the log messages, like a debug file
> for DEBUG log, INFO file for INFO log, and so on.
>
> b) i want my log file to have the format
> "yyyy-MM-dd-debug.log","yyyy-MM-dd-error.log", "yyyy-MM-dd-info.log", and 
> so
> on. In the sense i want it to roll-over at midnight!!! Can i have it that
> way. I had a look at the Appenders, but its appending at the end, i want 
> it
> in the beginning.
>
> Thanks & Regards,
> Kailash.K.N.
> # 71, 4th Floor,
> Sona Towers, Miller's Road,
> Bangalore - 560 052
> email : kailash_kn@yahoo.com
> Ph : +91-9886634958
>
> ******* DISCLAIMER: This email and any files transmitted with it are
> privileged and confidential information and intended solely for the use of
> the individual or entity to which they are addressed. If you are not the
> intended recipient, please notify the sender by e-mail and delete the
> original message. Further, you are not to copy, disclose, or distribute 
> this
> e-mail or its contents to any other person and any such actions are
> unlawful. This e-mail may contain viruses. Torry Harris Business Solutions
> has taken every reasonable precaution to minimize this risk, but is not
> liable for any damage you may sustain as a result of any virus in this
> e-mail.  The recipient should check this email and any attachments for the
> presence of viruses. THBS reserves the right to monitor and review the
> content of all messages sent to or from this e-mail address********
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
>
>


--
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: Format of LOG File!!!

Posted by James Stauffer <st...@gmail.com>.
a) Yes.

b) I think you would have to write your own appender to get that
format.  I wrote an appender that could handle that.

On 4/18/06, Kailash KN <ka...@thbs.com> wrote:
>
>
> Hi log4j team,
>
>        I'm new to log4j and jus trying to get a hands on experience on it. I
> have 2 queries as of now...
> a) Can i have different files to write the log messages, like a debug file
> for DEBUG log, INFO file for INFO log, and so on.
>
> b) i want my log file to have the format
> "yyyy-MM-dd-debug.log","yyyy-MM-dd-error.log", "yyyy-MM-dd-info.log", and so
> on. In the sense i want it to roll-over at midnight!!! Can i have it that
> way. I had a look at the Appenders, but its appending at the end, i want it
> in the beginning.
>
> Thanks & Regards,
> Kailash.K.N.
> # 71, 4th Floor,
> Sona Towers, Miller's Road,
> Bangalore - 560 052
> email : kailash_kn@yahoo.com
> Ph : +91-9886634958
>
> ******* DISCLAIMER: This email and any files transmitted with it are
> privileged and confidential information and intended solely for the use of
> the individual or entity to which they are addressed. If you are not the
> intended recipient, please notify the sender by e-mail and delete the
> original message. Further, you are not to copy, disclose, or distribute this
> e-mail or its contents to any other person and any such actions are
> unlawful. This e-mail may contain viruses. Torry Harris Business Solutions
> has taken every reasonable precaution to minimize this risk, but is not
> liable for any damage you may sustain as a result of any virus in this
> e-mail.  The recipient should check this email and any attachments for the
> presence of viruses. THBS reserves the right to monitor and review the
> content of all messages sent to or from this e-mail address********
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
>
>


--
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 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


New file not getting created next day...DailyRollingFileAppender

Posted by Inder Jeet Singh <in...@yahoo.co.in>.
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.