Stevan Little > Log-Dispatch-MongoDB-0.001 > Log::Dispatch::MongoDB

Download:
Log-Dispatch-MongoDB-0.001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Log::Dispatch::MongoDB - A MongoDB backend for Log::Dispatch

VERSION ^

version 0.001

SYNOPSIS ^

  my $log = Log::Dispatch->new;
  $log->add(
      Log::Dispatch::MongoDB->new(
          name       => 'my_web_logger',
          min_level  => 'debug',
          collection => $mongo_db->get_collection('web_log')
      )
  );

  $log->debug("Testing feature $x");

  $log->log(
      level   => 'info',
      message => 'Started processing web page',
      info    => {
          referer     => $ENV{HTTP_REFERER},
          user_agent  => $ENV{HTTP_USER_AGENT},
          remote_addr => $ENV{REMOTE_ADDR},
      }
  );

DESCRIPTION ^

This is a MongoDB backend for Log::Dispatch.

MongoDB is especially adept for logging because of it's asynchronous insert behavior, which means that your logging won't slow down your application. It is also nice in that you can store structured data as well as simple messages.

METHODS ^

log

With the log method, we not only store the level and message, but we store any other information you choose to passed in. Note that this feature does not work if you use the info, warn, debug methods, etc.

SEE ALSO ^

http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging

AUTHOR ^

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Infinity Interactive, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: