Log::Dispatch::Socket - Subclass of Log::Dispatch::Output that log messages to a socket
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().
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.
Loïc TROCHET <firstname.lastname@example.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.