I have a build script which maintains a global log file, and a separate log file for each build process. My current configuration is to code the global appender, then change appenders as the script works through the process. However, for ease of use, I would like to initialise the script externally (setting the global log file) and swap only the file-name, using one appender for the whole program. Is this possible? And how?
TIA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The appender in Log::Log4perl::Appender::File has a file_switch method:
"If you want to switch over to a different logfile, use the "file_switch($newfile)" method which will first close the old file handle and then open a one to the new file specified."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a build script which maintains a global log file, and a separate log file for each build process. My current configuration is to code the global appender, then change appenders as the script works through the process. However, for ease of use, I would like to initialise the script externally (setting the global log file) and swap only the file-name, using one appender for the whole program. Is this possible? And how?
TIA
The appender in Log::Log4perl::Appender::File has a file_switch method:
"If you want to switch over to a different logfile, use the "file_switch($newfile)" method which will first close the old file handle and then open a one to the new file specified."