Log::Dispatch::Socket - Subclass of Log::Dispatch::Output that log messages to a socket
version 0.130020
use Log::Dispatch; my $log = Log::Dispatch->new( outputs => [ [ 'Socket' , PeerHost => 'server.foo.com' , PeerPort => 9876 , Proto => 'tcp' , min_level => 'info' ] ] ); $log->info("Sorry for my (poor/beginner's/basic) English.");
This module provides, under the Log::Dispatch::* system, a simple object to write messages to a socket listening on some remote host.
It relies on IO::Socket::INET and offers all parameters this module offers.
If this module cannot contact the server during the initialization phase (while running the constructor new), it will die().
If this module fails to log a message because the socket's send() method fails , it will try to reconnect once. If it succeeds, the message will be sent. If the reconnect fails, this module will die().
The constructor offers all IO::Socket::INET parameters in addition to the standard parameters documented in Log::Dispatch::Output:
Sends a message if the level is greater than or equal to the object's minimum level.
We disconnect on destruction if it is necessary.
Log::Dispatch
Log::Dispatch::UDP
Log::Log4perl::Appender::Socket
Loïc TROCHET <losyme@cpan.org>
This software is copyright (c) 2012 by Loïc TROCHET.
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::Dispatch::Socket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Dispatch::Socket
CPAN shell
perl -MCPAN -e shell install Log::Dispatch::Socket
For more information on module installation, please visit the detailed CPAN module installation guide.