NAME

Log::Dispatch::Jabber - Log messages via Jabber

SYNOPSIS

 use Log::Dispatch;
 use Log::Dispatch::Jabber;

 my $dispatcher = Log::Dispatch->new();
 my $jabber     = Log::Dispatch::Jabber->new(
                                             name=>"jabber",
                                             min_level=>"debug",
                                             login=>{
                                                     hostname => "some.jabber.server",
                                                     port     => 5222,
                                                     username => "logger",
                                                     password => "*****",
                                                     resource => "logger",
                                                    },
	                                     to=>"someone\@a.jabber.server",
                                             # buffer => 5,
                                            );

 $dispatcher->add($jabber);

 $dispatcher->log(
		  level   => 'debug',
		  message => 'Hello. Programmer. This is '.ref($jabber)
		 );

DESCRIPTION

Log messages via Jabber.

ERRORS

All internal errors that the package encounters connecting to or authenticating with the Jabber server are logged to STDERR via Log::Dispatch::Screen.

PACKAGE METHODS

__PACKAGE__->new(%args)

Valid arguments are

  • name

    String.

    The name of the object.

    required

  • min_level

    String or Int.

    The minimum logging level this object will accept. See the Log::Dispatch documentation for more information.

    required

  • login

    A hash reference containting the following keys

    • hostname

      String.

      The name of the Jabber server that your object will connect to.

      Required

    • port

      Int.

      The port of the Jabber server that your object will connect to.

      Required

    • username

      String.

      The username that your object will use to log in to the Jabber server.

      Required

    • password

      String.

      The password that your object will use to log in to the Jabber server.

      Required

    • resource

      String.

      The name of the resource that you object will pass to the Jabber server.

      Required

  • to

    A string or an array reference.

    A list of Jabber addresses that messages should be sent to.

    Required

  • buffer

    String. The number of messages to buffer before sending.

    If the argument passed is "-" messages will be buffered until the object's destructor is called.

  • debuglevel

    Int. Net::Jabber debugging level; consult docs for details.

  • debugfile

    String. Where to write Net::Jabber debugging; default is STDOUT.

Returns an object.

OBJECT METHODS

This package inherits from Log::Dispatch::Output.

Please consult the docs for details.

VERSION

0.21

DATE

October 01, 2002

AUTHOR

Aaron Straup Cope

SEE ALSO

Log::Dispatch

Net::Jabber

TO DO

  • Figure out if it is possible to maintain a connection to the Jabber server between calls to log_message.

    If the package does not disconnect between messages but also doesn't do the AuthSend thing, anything after the first message is not sent. (Where does it go?)

    If the package does not disconnect and does the AuthSend thing, the Jabber server returns a '503' error which is a flag that something is wrong. Except, you can still send the message if you ignore the fact that everything is not 'ok'.

    Go figure.

  • Add featuritis that will allow the package to check the presence for the list of recipients and only send messages to the first person who is online.

BUGS

  • Even though you should be able to send a message to multiple recipients, and even though the debugging information seems to indicate that they are, only the first address in the to lists ever gets anything.

Please report all bugs to http://rt.cpan.org/NoAuth/Dists.html?Queue=Log::Dispatch::Jabber

LICENSE

Copyright (c) 2002, Aaron Straup Cope. All Rights Reserved.

This is free software, you may use it and distribute it under the same terms as Perl itself.