NAME
Beekeeper::Logger - Default logger used by worker processes.
VERSION
Version 0.04
SYNOPSIS
use Beekeeper::Worker ':log';
use base 'Beekeeper::Worker';
log_debug 'Ready';
log_warn 'Warning';
log_error 'Error';
DESCRIPTION
By default all workers use a Beekeeper::Logger
logger which logs errors and warnings both to files and to a topic 'log/{level}/{service}' on the message bus.
Logs location can be specified with option log_file
in config file pool.config.json
.
If no location is specified log files are are saved on /var/log
when running pools as root, or /var/log/{user}
when running as another user (if that directory already exists).
Log entries are also sent to a topic /topic/log
in the message bus. The command line tool bkpr-log
allows to inspect this topic in real time. Having a common topic for logs allows to easily shovel them to an external log management system.
To replace this default log mechanism for another one of your choice, just override in your worker classes the inherithed method log_handler
.
AUTHOR
José Micó, jose.mico@gmail.com
COPYRIGHT AND LICENSE
Copyright 2015-2021 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.