NAME

Dancer2::Logger::Syslog - Dancer2 logger engine for Sys::Syslog

VERSION

version 0.5

DESCRIPTION

This module implements a logger engine that sends log messages to syslog, through the Sys::Syslog module.

Note: You might want to use Dancer2::Logger::LogReport instead, which contains a syslog dispatcher, but is much more powerful than this module.

METHODS

log($level, $message)

Writes the log message to the file.

CONFIGURATION

The setting logger should be set to Syslog in order to use this logging engine in a Dancer2 application.

The attributes in the following example configuration are supported:

logger: "Syslog"

engines:
  logger:
    Syslog:
      facility: "LOCAL0"
      ident: "my_app"
      logopt: "pid"
      host: "10.0.0.1"
      port: "10000"
      type: "tcp"

The allowed options are:

facility

Which syslog facility to use, defaults to 'USER'

ident

String prepended to every log line, defaults to the configured appname or, if not defined, to the executable's basename.

logopt

Log options passed to openlog() as per Sys::Syslog's docs. Defaults to 'pid'.

host

host option passed if set to setlogsock() as per Sys:Syslog's docs

port

port option passed if host is set to setlogsock() as per Sys:Syslog's docs defaults to 53

type

type option passed if host is set to setlogsock() as per Sys:Syslog's docs defaults to udp

METHODS

DEPENDENCY

This module depends on Sys::Syslog. To use network logging it requires a minimum of version 0.33. Otherwise the network options are ignored.

SEE ALSO

See Dancer2 for details about logging in route handlers.

See Dancer2::Logger::LogReport for a much more powerful logger, which also contains a syslog provider.

AUTHORS

  • Andy Beverley <andy@andybev.com>

  • Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Andy Beverley, Yanick Champoux, Alexis Sukrieh

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