my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes Generating dynamic log file with dynamic file name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Generating dynamic log file with dynamic file name" Watch "Generating dynamic log file with dynamic file name" New topic
Author

Generating dynamic log file with dynamic file name

Abhishek Mish
Greenhorn

Joined: Dec 21, 2007
Posts: 29
Hi All,
I need to generate the log file every time with dynamic log file name.
As per my understanding it cannot be done from log4.properties as the name of the file is constant which is defined in the properties file.
In that case i need to write the custom File appender which generates the log file with dynamic name.
Let me know if there is any other good way of doing and also provide me with some good sample example.

Thanks,
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
What is the dynamic file name based on? System properties?
Tanzy Akhtar
Ranch Hand

Joined: Jul 19, 2009
Posts: 110
Hi Abhishek,

If you want to add timestamp with the log file name then
follow this.

Its been alraedy given by Carol.

Thanks Carol for giving such a useful link.


Thanks,
Tanzy.


Roll with punchers, there is always tomorrow.
Techie Blog -- http://jtanzy.blogspot.com/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Generating dynamic log file with dynamic file name
 
Similar Threads
Best way to manage multiple files?
arguments to a properties file
Log file not being created or appended to with log4j
MQJMS2005: failed to create MQQueueManager for 'WAS_localhost_server1'
generate dynamic log file in apache log4j