The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Log::Log4perl::Appender::Chunk::Store::Memory - Stores chunks in memory

SYNOPSIS

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();

store

See Log::Log4perl::Appender::Chunk::Store

clear

Clears the chunks storage.