in reply to To create a custom log

I'd suggest going with Log::Log4perl. Handles logging much more like syslog, and is easy to use.
use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($ERROR); DEBUG "This doesn't go anywhere"; ERROR "This gets logged";
Note the ability to set a log level (DEBUG is, I think, the default, but Log4perl has great docs). One hint: if you will be using Data::Dumper in a call to DEBUG, for instance, wrap it in an anonymous sub; that way Log4perl can skip doing the Dumper call altogether if DEBUG logging is off.

Replies are listed 'Best First'.
Re^2: To create a custom log
by sajanagr (Acolyte) on Aug 27, 2010 at 11:04 UTC
    Thank you all for your reply.

    But, the problem of logging is different now in my implementation.

    I have a server-client code based on Apache.

    I tried to create a custom log using the log module of Perl, but I didn't have permission to write to the file.

    While exploring, I did get Apache2::log module, which writes the error into error.log file of httpd properly.

    The problem now, is how can I have my own log file.

    Please help.