Proxy
NAME
Lumberjack::Dispatcher::Proxy - dispatch lumberjack messages to a web server
SYNOPSIS
use Lumberjack;
use Lumberjack::Dispatcher::Proxy;
Lumberjack.dispatchers.append: Lumberjack::Dispatcher::Proxy.new(url => 'http://localhost:8898/log');
# Now all messages will be dispatched to the web endpoint as well as the other dispatchers
DESCRIPTION
This implements a Lumberjack::Dispatcher
that will POST the messages
serialised as JSON to the specified URL. Typically the endpoint
will be provided by a Lumberjack::Application::PSGI
application
which knows how to deserialise and re-dispatch the messages, but you
can equally provide your own if you have different requirements.
METHODS
method new
method new(:$url!, :$username, :$password)
As well as the classes
and levels
matchers provided for
by the Lumberjack::Dispatcher
role, this has a required
url
parameter that should be the URI of a web service that
will accept an 'application/json' POST of the message data.
Additionally if the username
and password
parameters
are provided, it will attempt to authenticate with the HTTP
server, currently only basic authentication is provided, though
other mechanisms may become available in the future.