The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dancer2::Logger::File - file-based logging engine for Dancer2

VERSION

version 0.05

DESCRIPTION

This is a logging engine that allows you to save your logs to files on disk.

Logs are not automatically rotated. Use a log rotation tool like logrotate in copytruncate mode.

METHODS

log

Writes the log message to the file.

CONFIGURATION

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

The follow attributes are supported:

Here is an example configuration that use this logger and stores logs in /var/log/myapp:

logger: "File"

engines:
  logger:
    File:
      log_dir: "/var/log/myapp"
      file_name: "myapp.log"

For backwards compatibility, the log_path parameter may be given at the top level of the config file to set the log_dir attribute and the log_file parameter may be given to set the file_name attribute.

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by 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.