Skip to content

Instantly share code, notes, and snippets.

@bigpresh
Created May 3, 2011 21:33
Show Gist options
  • Save bigpresh/954303 to your computer and use it in GitHub Desktop.
Save bigpresh/954303 to your computer and use it in GitHub Desktop.
Dead simple test case for logging configured at runtime
[davidp@supernova:~/tmp/runtimeloggerconfig]$ perl runtimeloggerconfig.pl
>> Dancer 1.3030 server 19286 listening on http://0.0.0.0:3000
== Entering the development dance floor ...
^C
# a request was made, answered with the default error 500 page
[davidp@supernova:~/tmp/runtimeloggerconfig]$ cat logs/development.log
[davidp@supernova:~/tmp/runtimeloggerconfig]$
# Nothing logged.
[davidp@supernova:~/tmp/runtimeloggerconfig]$ cat runtimeloggerconfig.pl
#!/usr/bin/perl
use Dancer;
set logger => 'file';
set log => 'debug';
get '/' => sub {
die "Dieing in route handler - arrggghh!";
};
dance;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment