Caching Log4Perl object and using in various scriptsby chanakya (Friar)
|on Sep 14, 2009 at 12:32 UTC||Need Help??|
chanakya has asked for the wisdom of the Perl Monks concerning the following question:
Currently I am rewriting a bunch of perl scripts to improve performance and used couple of frameworks. One of them is Log::Log4perl
I have 20 perl scripts and one issue I have observed is, everytime a new script executes, a new Log4perl object is created. My idea is to create one Log4perl object and reuse the cached object across all the other scripts to save time in creating new object every time.
To achieve the above I was thinking about:
* Caching the Log4perl object once its created by the first script
* Other scripts use the cached object or it cached object is expired, instantiate the Log4perl object .
I'd like to know what Caching modules will help me achieve this, and also let me know if my approach is correct.
Thank you for your time