Menu

change log file

Help
2006-06-14
2013-06-04
  • arnold blaine

    arnold blaine - 2006-06-14

    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

     
    • Mike Schilli

      Mike Schilli - 2006-06-15

      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."

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.