|o||category passed to the constructor overrides all other values and will always be used if defined. This essentially fixes the Scribe category for this logger instance.|
|o||category passed to log_message() will be used otherwise, if defined.|
|o||log4p_category passed to log_message() will be used otherwise, if defined. Log4perl sets this parameter from the logger category.|
|o||default_category passed to the constructor is used where no other category parameters have been set. If no default_category is given, it defaults to none.|
A Scribe server is expected to be listening for log messages on a given host and port number.
The standard behaviour of most Log::Dispatch::* loggers is to die on error, such as when a file cannot be written. It is feasible that the Scribe server might be restarted from time to time resulting in temporary connection failures, and it would not be very satisfactory if ones Perl application should die just because of a temporary outage of the Scribe server. Log::Dispatch::Scribe offers several options for retrying delivery of log messages.
The retry behaviour is set through retry_plan_a and retry_plan_b parameters. Plan A is tried first, and if that fails, then Plan B. There is no Plan C. The retry_plan_* parameters may have any of the following values:
The default settings are:
o die o wait_forever o wait_count
The Perl application blocks, waiting for retry_delay seconds, up to retry_count times, then move on to the next plan if possible, otherwise die. (Note that the count is not doubled if both Plan A and B are wait_count).
Discard the current message and return immediately, allowing the Perl application to continue.
Buffer messages up to the given retry_buffer_size (a count of number of messages, not bytes), then move on to the next plan if the buffer fills. This allows the Perl application to continue at least until the buffer fills.
retry_plan_a => buffer, retry_buffer_size => 1000, retry_plan_b => discard,
in which case the first 1000 messages will be kept, then subsequent messages discarded until the Scribe service recovers. The first 1000 messages will then be flushed to Scribe as soon as it recovers.
new $log = Log::Dispatch::Scribe->new(%params);
This method takes a hash of parameters. The following options are valid:
o name, min_level, max_level, callbacks
Same as various Log::Dispatch::* classes.
o host, port
The host and port number of the Scribe server.
o category, default_category
See above under Scribe Categories.
o retry_plan_a, retry_plan_b
See above under Scribe Server and Error Handling.
o retry_buffer_size o retry_delay
For the wait_forever and wait_count retry plans, the time interval (in seconds) between attempts to reconnect. See above under Scribe Server and Error Handling. Defaults to 10 seconds.
For the wait_count retry plans, the number of times to retry before giving up. See above under Scribe Server and Error Handling. Defaults to 100.
log $log->log( level => $level, message => $message, category => $category )
As for log in Log::Dispatch, but also supports passing in a category parameter to specify the Scribe category, and log4p_category. See above under Scribe Categories.
o <http://notes.jschutz.net/109/perl/perl-client-for-facebooks-scribe-logging-software> o <http://github.com/facebook/scribe/> o Log::LogDispatch o Log::Log4perl o File::Tail::Scribe, tail_to_scribe.pl
Jon Schutz, <jon at jschutz.net>, <http://notes.jschutz.net>
Please report any bugs or feature requests to bug-log-dispatch-scribe at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Log-Dispatch-Scribe>. I will be notified, and then youll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
o RT: CPANs request tracker
o AnnoCPAN: Annotated CPAN documentation o CPAN Ratings o Search CPAN
Copyright 2009 Jon Schutz, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||LOG::DISPATCH::SCRIBE (3)||2010-03-23|