Reputation: 2789
I am trying to do something similar to Appending current time to a new log file each time log4j is initialized.
I am using log4c for logging. I would like to be able to create a new log file with each execution of the application. Is it possible to do this, by only modifying the log4crc config file.
All help will be greatly appreciated
ps: The tag I wanted to used is log4c, but it isn't there in SO
Upvotes: 1
Views: 878
Reputation: 11
I had a similar problem. It is now fixed in the current release, but Ubuntu for example still ships an older version without this facility.
See How to change log4c's default timezone?
Upvotes: 0
Reputation: 2789
Doesn't seem to be possible via any config file. I had to modify the appender used to name the log file based on the current time. I used the functions time()
, localtime()
and strftime()
to create the file name
Upvotes: 1