Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

log::agent::channel(3pm) [debian man page]

Agent::Channel(3pm)					User Contributed Perl Documentation				       Agent::Channel(3pm)

NAME
Log::Agent::Channel - ancestor class for all Log::Agent channels SYNOPSIS
@Log::Agent::Channel::XXX::ISA = qw(Log::Agent::Channel); DESCRIPTION
The "Log::Agent::Channel" class is the root class from which all "Log::Agent" channels inherit. It is a deferred class, meaning that it cannot be instantiated directly. All the deferred routines need to be implemented by its heirs to form a valid driver. Internally, the various "Log::Agent::Driver" objects create "Log::Agent::Channel" instances for each logging channel defined at driver creation time. The channels are therefore architecturally hidden within "Log::Agent", since this module only provides redefined mappings for the various logxxx() routines (logerr(), logwarn(), logdie(), etc...). However, this does not mean that channel classes cannot be used externally: the "Log::Agent::Logger" extension makes "Log::Agent::Channel" objects architecturally visible, thereby offering an application-level logging API that can be redirected to various places transparently for the application. CHANNEL LIST
The following channels are currently made available by "Log::Agent". More channels can be defined by the "Log::Agent::Logger" extension: Log::Agent::Channel::File This channel writes logs to files, defined by their path or via a magical opening sequence such as "|cmd". See Log::Agent::Channel::File. Log::Agent::Channel::Handle This channel writes logs to an already opened descriptor, as specified by its file handle: an IO::Handle object, or a GLOB reference such as *FILE. See Log::Agent::Channel::Handle. Log::Agent::Channel::Syslog This channel redirects logs to the syslogd(8) daemon, which will then handle the dispatching to various logfiles, based on its own configuration. See Log::Agent::Channel::Syslog. INTERFACE
You need not read this section if you're only using "Log::Agent". However, if you wish to implement another channel, then this section might be of interest. The following routines are deferred and therefore need to be defined by the heir: write($priority, $logstring) Emit the log entry held in $logstring, at priority $priority. A trailing " " is added to the $logstring, if needed (i.e. if the physical entity does not do it already, like syslog does). The $priority argument must be a valid syslog priority, i.e. one of the following strings: "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug". The $logstring may not really be a plain string. It can actually be a Log::Agent::Message object with an overloaded stringification routine, so the illusion should be complete. close Close the channel. make This is the creation routine. Its signature varies for each channel, naturally. AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com> SEE ALSO
Log::Agent::Channel::File(3), Log::Agent::Channel::Handle(3), Log::Agent::Channel::Syslog(3), Log::Agent::Logger(3). perl v5.10.0 2002-03-09 Agent::Channel(3pm)

Check Out this Related Man Page

Agent::Channel::Handle(3pm)				User Contributed Perl Documentation			       Agent::Channel::Handle(3pm)

NAME
Log::Agent::Channel::Handle - I/O handle logging channel for Log::Agent SYNOPSIS
require Log::Agent::Channel::Handle; my $driver = Log::Agent::Channel::Handle->make( -prefix => "prefix", -stampfmt => "own", -showpid => 1, -handle => *FILE, ); DESCRIPTION
The handle channel performs logging to an already opened I/O handle, along with the necessary prefixing and stamping of the messages. The creation routine make() takes the following arguments: "-handle" => handle Specifies the I/O handle to use. It can be given as a GLOB reference, such as "*FILE", or as an "IO::Handle" object. NOTE: Auto-flushing is not enabled on the handle. Even when the channel is closed, the handle is left as-is: we simply stop sending log messages to it. "-no_newline" => flag When set to true, never append any " " (on Unix) or " " (on Windows) to log messages. Internally, Log::Agent relies on the channel to delimit logged lines appropriately, so this flag is not used. However, it might be useful for "Log::Agent::Logger" users. Default is false, meaning newline markers are systematically appended. "-no_prefixing" => flag When set to true, disable the prefixing logic entirely, i.e. the following options are ignored completely: "-prefix", "-showpid", "-no_ucfirst", "-stampfmt". Default is false. "-no_ucfirst" => flag When set to true, don't upper-case the first letter of the log message entry when there's no prefix inserted before the logged line. When there is a prefix, a ":" character follows, and therefore the leading letter of the message should not be upper-cased anyway. Default is false, meaning uppercasing is performed. "-prefix" => prefix The application prefix string to prepend to messages. "-showpid" => flag If set to true, the PID of the process will be appended within square brackets after the prefix, to all messages. Default is false. "-stampfmt" => (name | CODE) Specifies the time stamp format to use. By default, my "own" format is used. See Log::Agent::Stamping for a description of the available format names. You may also specify a CODE ref: that routine will be called every time we need to compute a time stamp. It should not expect any parameter, and should return a string. CAVEAT
Beware of chdir(). If your program uses chdir(), you should always specify logfiles by using absolute paths, otherwise you run the risk of having your relative paths become invalid: there is no anchoring done at the time you specify them. This is especially true when configured for rotation, since the logfiles are recreated as needed and you might end up with many logfiles scattered throughout all the directories you chdir()ed to. AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com> SEE ALSO
Log::Agent::Logger(3), Log::Agent::Channel(3). perl v5.10.0 2002-03-09 Agent::Channel::Handle(3pm)
Man Page