Log::Dispatch::Atom

Log::Dispatch::Atom is a Perl module to log to an atom feed.
Download

Log::Dispatch::Atom Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dominic Mitchell
  • Publisher web site:
  • http://search.cpan.org/~semantico/

Log::Dispatch::Atom Tags


Log::Dispatch::Atom Description

Log::Dispatch::Atom is a Perl module to log to an atom feed. Log::Dispatch::Atom is a Perl module to log to an atom feed.SYNOPSIS use Log::Dispatch::Atom; my $log = Log::Dispatch::Atom->new( name => 'foo', min_level => 'debug', file => 'file.atom' ); $log->log_message( level => 'error', message => 'A problem happened' ); $log->log_message( level => 'debug', message => 'Got Here' );This class implements logging backed by an Atom feed so that you can subscribe to the errors produced by your application.You should not use this object directly, but should manage it via a Log::Dispatch object.IMPLEMENTATION NOTESIn order to safely write to the log file, the entire file must be locked each time that an entry is logged. This probably makes it unsuitable for high volume log files.The log file is opened and closed on each call to log_message().METHODSnew()Takes a hash of arguments. Returns a new Log::Dispatch::Atom object. The following parameters are used:name The name of the logging object.min_level The minimum logging level this object will accept. See Log::Dispatch for more information.max_level The maximum logging level this object will accept. See Log::Dispatch for more information. The default is the highest possible level (ie: no maximum).file Specifies the location of the file to read/write the feed from.feed_id Specifies the identity of the feed itself. Normally, this should be set to the published URI of the feed.If not specified, it will be omitted, which is in violation of the Atom specification. For more information, see http://www.atomenabled.org/developers/syndication/#requiredFeedElements.feed_title The title of the feed. This should probably be set to the name of your application.If not specified, it will be omitted, which is in violation of the Atom specification. For more information, see http://www.atomenabled.org/developers/syndication/#requiredFeedElements.XXX This should probably just use the name parameter. What do you think? Let me know.feed_author The author details of a feed. This is specified as a hash reference, which must contain one or more of the three keys name, email and uri.In order to create a valid Atom feed, you must either supply an author in every single entry (log message), or ensure that the feed itself has an author. The latter is probably the easier solution, so I recommend this parameter be supplied.NB: The feed_* parameters will only be used when a new feed is being created. If you are creating a new object for an existing feed, they will be ignored.log_message()Takes a hash of arguments. Has no return value. The following parameters are used.message The actual log message.level The level of the message. See Log::Dispatch for a full list.id Each entry requires an id in order for the feed as a whole to be a valid Atom document. It's used by readers of Atom documents to determine whether or not an entry has been seen previously.If not specified, this will default to an URL comprising the current time plus the pid plus the hostname plus a monotonically increasing integer. eg: tag:fred.example.com,2005-12-07:1133946771/20827/2. This should be good enough for a uniqueness test.author You can specify author details for an individual entry if desired. The author parameter is expected to be a hash reference, which must contain one or more of the keys name, email or uri.


Log::Dispatch::Atom Related Software