Log::Log4perl::Appender::Chunk::Store::Memory - Stores chunks in memory
Fist make sure you read Log::Log4perl::Appender::Chunk documentation.
l4p.conf:
log4perl.rootLogger=TRACE, Chunk layout_class=Log::Log4perl::Layout::PatternLayout layout_pattern=%m%n log4perl.appender.Chunk=Log::Log4perl::Appender::Chunk # Built-in store class Memory log4perl.appender.Chunk.store_class=Memory
Then from your code:
my $store = Log::Log4perl->appender_by_name('Chunk')->store();
You can then inspect
$store->chunks(); # A hash of all the chunks by chunk ID
Save memory from time to time:
$store->clear();
See Log::Log4perl::Appender::Chunk::Store
Clears the chunks storage.
To install Log::Log4perl::Appender::Chunk, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Log4perl::Appender::Chunk
CPAN shell
perl -MCPAN -e shell install Log::Log4perl::Appender::Chunk
For more information on module installation, please visit the detailed CPAN module installation guide.