NAME

Beekeeper::Service::LogTail - Buffer log entries

VERSION

Version 0.01

SYNOPSIS

my $l = Beekeeper::Service::LogTail->tail(
    count   => 100,
    level   => LOG_DEBUG,
    host    => '.*', 
    pool    => '.*', 
    service => 'myapp-foo',
    message => 'Use of uninitialized value',
    after   =>  now() - 10,
);

DESCRIPTION

By default all workers use a Beekeeper::Logger logger which logs errors and warnings both to files and to a topic /topic/log on the message bus.

This service keeps an in memory buffer of every log entry sent to that topic in every broker in a logical message bus.

The command line tool bkpr-log use this service to inspect logs in real time.

This can be used to shovel logs to an external log management system.

METHODS

tail ( %filters )

Returns all buffered entries that match the filter criteria.

The following parameters are accepted:

count: Number of entries to return, default is last 10.

level: Minimal severity level of entries to return.

host: Regex that applies to worker host.

pool: Regex that applies to worker pool.

service: Regex that applies to service name.

message: Regex that applies to error messages.

after: Return only entries generated after given timestamp.

SEE ALSO

bkpr-log.

AUTHOR

José Micó, jose.mico@gmail.com

COPYRIGHT AND LICENSE

Copyright 2015 José Micó.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language itself.

This software is distributed in the hope that it will be useful, but it is provided “as is” and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.