04 Oct 2015 09:05:44 UTC
- Distribution: Log-Any-Adapter-Redis
- Module version: 1.000
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (531 / 0 / 0)
- KwaliteeBus factor: 0
- 60.00% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (75.55KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMILA Michael Langner
Why not adopt me?This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.
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.
log_levelattribute may be set to define a minimum level to log.
Category is ignored.
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.
Module Install Instructions
To install Log::Any::Adapter::Redis, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Log::Any::Adapter::Redis
For more information on module installation, please visit the detailed CPAN module installation guide.