This question about Configuration: Answered

Creating a new log file every month

Ever since the log files were moved to the working directory - all the activities are getting tracked in events.log Is there a way to create a new log file every month?

Waiting for a reply...


The PlainFile Logger should automatically roll the current log file into a date based file name, and open a new file at the beginning of the month. The current month's logs will always be found in events.log, and prior months in events.yyyymm.

-- GeorgeClark - 01 Jun 2011


I do have PlainFile Logger, however a new log file does not get created every month - there is only one huge events.log

-- GuruprasadIyer - 08 Nov 2011


Please check the permissions on the working/logs directory. Is foswiki allowed to write new files into that directory? I'm not sure what else might cause this, although this seems unlikely. I tried to recreate the issue and the log is still rotated, but foswiki is unable to write the new events log.

I think I've recreated your issue by setting the working/logs directory to 555. The events.log file continues to be written to and the rotate fails. Adding some debug print statements, the rotate fails - could not create events.yyyymm.

Note that if I recreate the error by setting the file permissions, it is also reported in Configure that the Log directory is not writable. Do you get any configure errors?

-- GeorgeClark - 27 Nov 2011


This problem still persists in Foswiki 1.1.5

-- GuruprasadIyer - 15 Oct 2012

We found a significant issue in how the PlainFile handles rotating the logfiles. See Support/KnownIssuesOfFoswiki01x01#Major_issues, and Tasks.Item12022. There is a patch available that might be helpful. (The issue is that the time to copy large log files during rotation is excessive and the are conflicts accessing the logs), or you could convert back to the Compatibility logger (though that requires editing your LocalSite.cfg manually. Another option is the experimental Extensions/Testing/LogDispatchContrib. We hope that it will eventually become the default logger. It's been working find during testing, but it has not been put into production use yet.

-- GeorgeClark - 15 Oct 2012

QuestionForm edit

Subject Configuration
Extension
Version Foswiki 1.1.5
Status Answered
Related Topics
Topic revision: r7 - 15 Oct 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy