Change logging file while logging.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cagatay_Tunali
Posted On:   Tuesday, March 7, 2006 10:37 AM

I have an application which logs regularly. My log4j configuration is something like that: As you can see from my configuration file, I will have 10 log files in logs directory wtih the size of 5MB. Sometimes I need to stop logging to actual file before its size reaches 5MB. As an example, assume I have "Server.log", "Server.log.1" and "Server.log.2". In normal case when the size of the "Server.log" file reaches 5MB, the names of the files and actual file will be changed. And a new empty file "Server.log" will be created. Sometimes I need this behaviour before the actual log file size's reaches 5MB. Is it possible to have this beh   More>>

I have an application which logs regularly. My log4j configuration is something like that:











As you can see from my configuration file, I will have
10 log files in logs directory wtih the size of 5MB. Sometimes I need to stop logging to actual file before its size reaches 5MB. As an example, assume I have "Server.log", "Server.log.1" and "Server.log.2". In normal case when the size of the "Server.log" file reaches 5MB, the names of the files and actual file will be changed. And a new empty file "Server.log" will be created. Sometimes I need this behaviour before the actual log file size's reaches 5MB. Is it possible to have this behaviour. Or is there a command to do this.
Thank you very much...

   <<Less

Re: Change logging file while logging.

Posted By:   ankush_purwar  
Posted On:   Tuesday, March 7, 2006 01:48 PM

It seems you want control over the rollover condition.
When it should create a new file. Why not you extend rolling file appender and override the rollover functionality only.
Hope it helps you.
About | Sitemap | Contact