Egg::Plugin::Log::Syslog - Plugin for Sys::Syslog.


Egg-Plugin-Log-Syslog documentation  | view source Contained in the Egg-Plugin-Log-Syslog distribution.

Index


NAME

Top

Egg::Plugin::Log::Syslog - Plugin for Sys::Syslog.

SYNOPSIS

Top

  use Egg qw/ Log::Syslog /;

  # It writes it in the log.
  $e->slog(' log message ');

DESCRIPTION

Top

It is a plugin to use Log::Syslog module.

CONFIGRATION

Top

First of all, please set Syslog.

  # * It is a setting example for Linux.

  % vi /etc/syslog.conf
  local3.*    /var/log/myapp_log

  % /sbin/service syslog restart

  # Whether the setting became effective is confirmed.
  % logger -p local3.debug ' TEST OK!! '
  % tail /var/log/myapp_log

After the above-mentioned is set, the setting of plugin_syslog is added to the configuration of the project.

  plugin_syslog => {
    facility    => 'local3',
    handle      => 'MYAPPLOG',
    unix_socket => 1,
    level       => 'debug',
    },

It is as follows of each item.

* facility

Name of log facility set to 'syslog.conf'.

* handle

Electronic alias when log is opened.

Default is a project name.

* unix_socket

setlogsock('unix') is issued when making it to true.

* There seems to be a thing that cannot be written well if this is not done according to the environment.

Default is false.

* level

It is a log level. It always writes it at the log level set by this.

And, it might be good to put the setting of the following rotations on '/etc/logrotate.d'.

  /var/log/myapp_log {
    weekly
    missingok
    notifempty
  }

* I think that it should reactivate the WEB server and the database server after it rotates.

METHODS

Top

slog ([LOG_MESSAGE])

LOG_MESSAGE is written the log.

  $e->slog(' myapp memo. ');

SEE ALSO

Top

Sys::Syslog, Egg::Release,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT

Top


Egg-Plugin-Log-Syslog documentation  | view source Contained in the Egg-Plugin-Log-Syslog distribution.