When you 'use' the Log::Handler::Plugin::DBI Perl module (as in the Synopsis), it automatically imports into your class several methods. See "Methods" for details.
Synopsis
Firstly, use your config file to connect to the db and create the 'log' table.
Then:
package My::App;
use strict;
use warnings;
use Config::Plugin::Tiny; # For config_tiny().
use Log::Handler::Plugin::DBI; # For configure_logger() and log().
# ------------------------------------------------
sub marine
{
my($self) = @_;
my($config) = $self -> config_tiny('/some/dir/config.tiny.ini');
$self -> configure_logger($$config{logger});
$self -> log(debug => 'Hi from sub marine()');
} # End of marine.
# --------------------------------------------------
1;
t/config.logger.ini is used in the test file t/test.t, and also ships with the CGI::Snapp::Demo::Four distro.
Product's homepage
Requirements:
· Perl