in reply to Writing to a Logfile from a Perl Console Application.

Check out Log::Dispatch. It will log to multiple destinations (screen, file, mail, syslog, etc.) and has various severity levels ala syslog (i.e. warnings, errors, debug, etc.). It is easy to provide you own format for each destination.

One way I have warn and die (and their ilk) log through this is just to provide my own __WARN__ and __DIE__ "signal handlers" and then call the appropriate logging method from within them. This is kludegy, but it tends to work ok.

bluto

  • Comment on Re: Writing to a Logfile from a Perl Console Application.

Replies are listed 'Best First'.
Re: Re: Writing to a Logfile from a Perl Console Application.
by Anonymous Monk on Jul 12, 2002 at 06:39 UTC
    Thanks so much,

    I'm particulary fond of the "-callbacks" feature. It let's me customize the output based on the channel.

    Cheers!