Log::Handler::Changes - Changes from 0.38 to 0.40.
Since version 0.40 the method add() is totaly new. With this method you can add outputs as much as you wish, each with its own level range and different other options. As example you can add a output for the levels 0-4 (emergency-warning) and another output for the levels 4-7 (warning-debug). Each output is handled as a own object.
add()
There are different output modules available:
Log::Handler::Output::File Log::Handler::Output::DBI Log::Handler::Output::Email Log::Handler::Output::Forward Log::Handler::Output::Screen Log::Handler::Output::Socket
You can add the outputs on different ways. Take a look to the further documentation of Log::Handler.
Placeholders are now available for the message layout in printf() style. The old style of <--LEVEL--> is deprecated and you should use %L instead. The layout can be defined with the option message_layout.
printf()
%L
message_layout
The option prefix is deprecated.
prefix
Now it's possible to load the configuration from a file. There are 3 configuration plugins available:
Config::General Config::Properties YAML
Take a look into the documentation for Log::Handler::Config.
dateformat priority message_pattern prepare_message filter alias
prefix is now message_layout debug is now debug_trace
rewrite_to_stderr
add() to add new outputs config() to load outputs from a configuration file set_pattern() to create your own placeholder get_output() to get a output object with an alias
Please take a look to Log::Handler::Levels because the list is very long.
note() close() get_prefix() set_prefix()
trace() replaced with trace methods for each level warn() still exist but is a replacement vor carp() now
As I re-designed Log::Handler it was my wish to support all things from version 0.38.
Log::Handler
my $log = Log::Handler->new(filename => 'file.log');
This is still running fine. It creates a Log::Handler::Simple object with all features of Log::Handler from version 0.38.
Log::Handler::Simple
Extensions and changes are planed. I hope I have enough time to implement my ideas as soon as possible!
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
To install Log::Handler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Handler
CPAN shell
perl -MCPAN -e shell install Log::Handler
For more information on module installation, please visit the detailed CPAN module installation guide.