Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

CPAN Module for logging framework

by shree (Acolyte)
on Aug 24, 2011 at 13:30 UTC ( [id://922107]=perlquestion: print w/replies, xml ) Need Help??

shree has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I am implementing a logging framework for a project. Here my requirement is that, the log has to get rotate automatically for each 5 minutes.

As I knew we have several CPAN Modules for implement logging mechanism.

Like:
Log::Log4perl Log::Dispatch Log::Dispatch::File::Rolling Log::Dispatch::FileRotate
But I am not sure that which of the above will suitable for my requirements.

Is anyone used any of these for such requirements if so, please suggest me that which one will be proper and sure, among above all.

Replies are listed 'Best First'.
Re: CPAN Module for logging framework
by blue_cowdawg (Monsignor) on Aug 24, 2011 at 13:35 UTC
        Is anyone used any of these for such requirements if so, please suggest me that which one will be proper and sure, among above all.

    Suggest you take a closer look at Log::Dispatcher::FileRoate. This module has the notion of rotating files on a date/time basis as well as a size basis.

    Is your logging volume really large enough to justify five minute rotations? Seems a bit excessive to me...


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: CPAN Module for logging framework
by ctilmes (Vicar) on Aug 24, 2011 at 13:47 UTC
    Consider using 'logrotate'. It may be available already for your platform (or is easy to install if it isn't). It has very flexible log rotating mechanisms you can use across your Perl and non-Perl applications.

    You'll still need a good CPAN logging module to create the log in the first place.

Re: CPAN Module for logging framework
by Marshall (Canon) on Aug 24, 2011 at 16:43 UTC
    I am quite astonished if you mean that you need to start a new log file every 5 minutes! WOW!

    How many log entries do you expect during this 5 minute window?
    What is the average number of entries in 5 minutes?
    What is the size of a typical log entry (in bytes)?
    What happens to the log file that is 15 minutes old?
    How often do you process these log files?
    How complex is that analysis of the log file?

    You are describing an unusual performance requirement. That is fine, but please add some more details about it.

    I am not sure that which of the above will suitable for my requirements.
    I don't understand your requirements. The answers to the questions above could lead me to very different recommendations for implementation.
Re: CPAN Module for logging framework
by duyet (Friar) on Aug 24, 2011 at 16:23 UTC
    If you are on the Unix/Linux system, you might want to have a look at cronolog

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://922107]
Approved by DrWhy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found