Haineko::Log - Syslog interface
Write log messages via UNIX syslog
use Haineko::Log; my $v = { 'remoteaddr' => '127.0.0.1', 'remoteport' => 1024, }; my $e = Haineko::Log->new( %$v ); my $x = { 'message' => 'Log message' }; $e->w( 'info', $x ); # Jul 4 10:00:00 host haineko[6994]: client=127.0.0.1:1024, message='Log message' $x = { 'message' => 'Rejected', 'dsn' => '5.2.1', 'code' => 550 }; $e->w( 'err', $x ); # Jul 4 10:00:00 host haineko[6994]: client=127.0.0.1:1024, message='Rejected', dsn=5.2.1, code=550 $v = { 'remoteaddr' => '192.0.1.2', 'queueid' => 'r67HY3E06994bogA' }; $e = Haineko::Log->new( %$v ); $x = { 'message' => [ 'Log1', 'Log2' ] 'neko' => 'Nyaa' }; $e->w( 'err', $x ); # Jul 4 10:00:00 host haineko[6994]: queueid=r67HY3E06994bogA, client=192.0.2.1, message='Log1 | Log2', neko=Nyaa
new( %arguments )
new() is a constructor of Haineko::Log
new()
my $e = Haineko::Log->new( 'queueid' => 'ID string', # Haineko::SMTPD::Session->queueid 'useragent' => 'Agent name', # $self->req->header->user_agent 'remoteaddr' => '127.0.0.1', # REMOTE_HOST http environment variable 'remoteport' => 1024, # REMOTE_PORT http environment variable );
w( log-level, argument)
w() write log messages via UNIX syslog
w()
my $e = Haineko:::Log->new( %argvs ); my $m = { 'message' => 'error', 'cat' => 'kijitora' }; $e->w( 'err', $m );
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.