Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.03 KB

enable_logging.md

File metadata and controls

43 lines (29 loc) · 1.03 KB

Enable logging

Just add a directory named log to you application root folder.

$ cd my_app
$ mkdir log

However this tip does not seem to work with newer version of Mojolicious, so you might have to add the following to your application.

Mojolicious::Lite

use Mojo::Log;

my $log = Mojo::Log->new( path => 'log/development.log', level => 'debug' );
app->log($log);

Mojolicious Application

use Mojo::Log;

# Log to STDERR
my $log = Mojo::Log->new;

# Customize log file location and minimum log level
my $log = Mojo::Log->new(path => '/var/log/mojo.log', level => 'warn');

Above example lifted from Mojo::Log

Resources and References