GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LOG::LOG4PERL::APPENDER::SOCKET::UNIX (3)

.ds Aq ’

NAME

Log::Log4perl::Appender::Socket::UNIX- Log to a Unix Domain Socket

CONTENTS

SYNOPSIS



        use Log::Log4perl::Appender::Socket::UNIX;

        my $appender = Log::Log4perl::Appender::Socket::UNIX->new(
                Socket => /var/tmp/myprogram.sock
        );

        $appender->log(message => "Log me\n");



DESCRIPTION

This is a simple appender for writing to a unix domain socket. It relies on Socket and only logs to an existing socket - ie. very useful to always log debug streams to the socket.

The appender tries to stream to a socket. The socket in questions is beeing created by the client who wants to listen, once created the messages are coming thru.

EXAMPLE

Write a client quickly using the Socket module:



        use Socket;

        my $s = "/var/tmp/myprogram.sock";

        unlink($s) or die("Failed to unlin socket - check permissions.\n");

        # be sure to set a correct umask so that the appender is allowed to stream to:
        # umask(000);

        socket(my $socket, PF_UNIX, SOCK_DGRAM, 0);
        bind($socket, sockaddr_un($s));

        while (1) {
                while ($line = <$socket>) {
                        print $line;
                }
        }



COPYRIGHT AND LICENSE

Copyright 2012 by Jean Stebens <debian.helba@recursor.net>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 APPENDER::SOCKET::UNIX (3) 2012-06-18

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.