Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Keep It Simple, Stupid
 
PerlMonks  

Re: Log File

by daxim (Chaplain)
on Oct 15, 2012 at 07:58 UTC ( #999023=note: print w/ replies, xml ) Need Help??


in reply to Log File

See How can I roll over my logfiles automatically at midnight? in Log::Log4perl::FAQ:

When using Log::Dispatch::FileRotate, all you have to do is specify it in your Log::Log4perl configuration file and your logfiles will be rotated automatically.

You can choose between rolling based on a maximum size ("roll if greater than 10 MB") or based on a date pattern ("roll everyday at midnight").


Comment on Re: Log File
Re^2: Log File
by Anonymous Monk on Oct 15, 2012 at 09:29 UTC

    Reading the faq i see that module Log::Dispatch::FileRotate can help me. But I am nt able to know how to use it? I am giving the code i am using presently::

    open(LOG,">file.txt") some code print LOG,"message"; some code print LOG,"message"; close(LOG;)

    How can i implement the above code through Log::Dispatch::FileRotate to change filename if size exceeds 10 mb?

      First, install the module from CPAN. Second, declare use of the module in your code (see use) . Third, call the module (as described in the module FAQ) at the desired point in your existing code.

      Additional info about modules can be found here. If you still have questions, consider checking other parts of perlintro as well.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-04-18 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls