Posthumous has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks:

I use Perl for various system admin tasks primarily on Win32 machines with Activestate Perl 5.8. Until now, I have been logging my scripts' output with the basic open-file/write/close-file process.

I'd like to begin making my logging easier, more efficient, and consistent. I've been looking for a module that may help me do this. After days of searching, reading, and evaluating, I'm no closer to a choice or even a decision whether a logging module is a good idea.

I'd like to get your opinions on a good logging module for system admin scripts, if such an animal exists.

If possible, I'd like to stick with modules available through Activestate's ppm repository. Of course, that is not absolutely necessary.

Replies are listed 'Best First'.
Re: Logging for System Admin Scripts
by chargrill (Parson) on Dec 28, 2006 at 18:34 UTC

    Hi Posthumous,

    I was about to recommend Log::Log4Perl, but then thought it might be prudent to see what ActiveState's PPM Build Status Page had to say about it. I scrolled all the way down to Log::Log4Perl, and saw that it passed most of the build tests but one, and thought it might be of value to you. But then I scrolled back up and saw the column heading for the platform for the single failure was Windows :(

    I'd recommend browsing around CPAN for "log" to see what you find that looks to fill your purposes, and then check the ActiveState's PPM Build Status Page for that module.

    HTH



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

      Log4perl really is worth doing, esp. if you want to never have to worry about your logging system running out of capabilities to meet new requirements as they present themselves.

      I've never done the install myself, but the Log::Log4perl author provides instructions in his FAQ for getting the module working on windows.

      non-Perl: Andy Ford

        Thanks to all for helping me shorten my search from a very long list of modules to two.

        Andy:

        Good news -- the Log4Perl module is in the Activestate repository.

        I'm off to do some installs and experimenting.

Re: Logging for System Admin Scripts
by alpha (Scribe) on Dec 28, 2006 at 18:29 UTC