logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Paranoid::Log::File - File Logging Functions

Author

       Arthur Corliss (corliss@digitalmages.com)

Bugs And Limitations

       This  isn't  a high performance module when dealing with a high logging rate with high concurrency.  This
       is due to the advisory locking requirement and the seeks to the end of the file with every message.  This
       facility is intended as a kind of lowest-common denominator for programs that need some kind  of  logging
       capability.

Dependencies

       o   Fcntl

       o   Paranoid::Debug

       o   Paranoid::Filesystem

       o   Paranoid::Input

       o   Paranoid::IO

Description

       This provides a mechanism to log to log files.  It will log arbitrarily long text, but also provides a
       syslog mode which limits log lines to 2048 and precedes text with the standard syslog preamble
       (date/time, host, process name/PID).

       The only mandatory option is the file key/value pair.  This module leverages Paranoid::IO's popen.

       mode defaults to O_CREAT | O_APPEND | O_WRONLY.'

       perm defaults to 0666 ^ UMASK

       syslog defaults to false.  Enabling it causes every line to be formatted akin to syslog, along with the
       2048 byte limit on messages.

Name

       Paranoid::Log::File - File Logging Functions

Options

       The options recognized for use in the options hash are as follows:

           Option      Value       Description
           -----------------------------------------------------
           file        string      file name of log file
           mode        integer     file mode to open with
           perm        integer     file permissions of newly
                                   created log files
           syslog      boolean     enable syslog-style format

See Also

       o   Paranoid::Log

Subroutines/Methods

NOTE:  Given that this module is not intended to be used directly nothing is exported.

   initlogMsgaddLoggerdelLogger

Synopsis

         use Paranoid::Log;

         startLogger('events', 'File', PL_DEBUG, PL_GE,
           {
             file   => '/var/log/events.log',
             mode   => O_TRUNC | O_CREAT | O_RDWR,
             perm   => 0600,
             syslog => 1,
           });

Version

       $Id: lib/Paranoid/Log/File.pm, 2.10 2022/03/08 00:01:04 acorliss Exp $

See Also