Log::Any::Adapter::Redis - Simple adapter for logging to redis
use Log::Any::Adapter ('Redis', host => 'localhost', port => '6379', key => 'LOG', # list name log_hostname => 0, log_pid => 0, database => 0 ); # or, using the defaults use Log::Any::Adapter ('Redis'); # or use Log::Any::Adapter; ... Log::Any::Adapter->set('Redis', host => 'localhost', port => '6379', key => 'LOG', log_hostname => 0, log_pid => 0, database => 0 ); # with minimum level 'warn' use Log::Any::Adapter ( 'Redis', log_level => 'warn' ); # re-use existing RedisDB object use Log::Any::Adapter ( 'Redis', redis_db => $my_redis_db );
This simple Log::Any adapter logs (RPUSH) each message to the specified list in redis, with a datestamp prefix. This Approach is useful when you have several processes, maybe even running on different machines, and need a fast, central logging solution. An example logwriter is included in the examples.
The log_level attribute may be set to define a minimum level to log.
log_level
Category is ignored.
Log::Any, Log::Any::Adapter
Michael Langner, mila at cpan dot org
The module is heavily based on Log::Any::Adapter::File by Jonathan Swartz and David Golden.
This software is copyright (c) 2015 by Michael Langner.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Log::Any::Adapter::Redis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Any::Adapter::Redis
CPAN shell
perl -MCPAN -e shell install Log::Any::Adapter::Redis
For more information on module installation, please visit the detailed CPAN module installation guide.