There are two types of logs available for Runtime and for Studio. These are controlled by the RuntimeConfig.xml and the StudioConfig.xml settings. For instruction on configuring this, search the online help for Runtime Configuration. The two types are:
File Publisher produces a single log for the life of the Runtime/Studio session. You can determine the number of files to keep. A log will roll off each time you start the Runtime/Studio. These log files can get large when the logging is set to Verbose. It is not recommended to leave this running in production, but is essential for debugging while in development and QA.
Log4Net Publisher produces logs that look similar to the File Publisher. Log4Net is a rolling log system which is useful when you want to keep logging running all the time. You can specify the maximum log file size and the number of logs to keep.
It is not necessary to have both publishers running at the same time. The both produce the same information. Choose the method that suits your need.
Should have checked the config file first. A few points to check though:
- is it not possible to redirect different automations to different log files?
- is it not possible to specify the age of keeping log files, rather than the number of generations as per maxSizeRollBackups?
- is it not possible to specify the file extension to be *.YYYYMMDD, rather than *.1, *.2, etc?
The last two questions have the same aim: if we specify rollingStyle to "Date" rather than "Size", a single day's file might get quite large; if we specify "Both" we don't know what value to set maxSizeRollBackups to in order to keep the log for one week.
Lots of questions today ... here are the best answers I can find:
It is not possible to redirect where items get logged. They get written to both log file publishers all the time. You can change the level of logging for categories but both log files share the same configuration for that.
No, Log4Net is an Open Source component and this is the standard rolling that is allowed.
At this point the answer is no. Theoretically, this should be possible but this would require a feature request.
Setting the value to Both will cause the files to roll at either the date or the size, whichever comes first. You will need to set the maxSizeRollBackups to a large enough number to maintain all of your backups. The simplest way to do this would be write a small routine that checks for first run of the day and archives the previous days logs in a folder by date. Just clean up your old log files that you want to roll off at that time.
Hi Jeff, thank you for your replies. The generational logging issue has been answered so I marked it as so. Incidentally we won't use date and size, we'll just use date so there'll be a tiny chance of really large log files if something goes wrong.
The automation specific log level/location actually had a different use case so I split it out to a new issue here: