GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Paranoid::Log::File(3) User Contributed Perl Documentation Paranoid::Log::File(3)

Paranoid::Log::File - File Logging Functions

$Id: lib/Paranoid/Log/File.pm, 2.08 2020/12/31 12:10:06 acorliss Exp $

  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,
    });

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.

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

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

o
Fcntl
o
Paranoid::Debug
o
Paranoid::Filesystem
o
Paranoid::Input
o
Paranoid::IO

o
Paranoid::Log

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.

Arthur Corliss (corliss@digitalmages.com)

This software is free software. Similar to Perl, you can redistribute it and/or modify it under the terms of either:

  a)     the GNU General Public License
         <https://www.gnu.org/licenses/gpl-1.0.html> as published by the 
         Free Software Foundation <http://www.fsf.org/>; either version 1
         <https://www.gnu.org/licenses/gpl-1.0.html>, or any later version
         <https://www.gnu.org/licenses/license-list.html#GNUGPL>, or
  b)     the Artistic License 2.0
         <https://opensource.org/licenses/Artistic-2.0>,

subject to the following additional term: No trademark rights to "Paranoid" have been or are conveyed under any of the above licenses. However, "Paranoid" may be used fairly to describe this unmodified software, in good faith, but not as a trademark.

(c) 2005 - 2020, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2020, Paranoid Inc. (www.paranoid.com)

2020-12-31 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.