Thanks a lot for your responses guys. I appreciate your viewpoints.
I have used syslog till now for all of my work and it works like charm. But we wanted to have a logging module which we can customize from ground up and through which we can do the following:
1. log to file or database directly. I know that logging to a database would be a major I/O hit so read on.
2. log to a file using standard templates. As in I should be able to make a call like
$logobj(245, {'name' => 'saurabh', 'game' => 'tennis'})
That would check whether 245 is a valid message template id in a db file and if it is log a message to the log file of the format - program_name|program_action|tmpl_id|tmpl_params
This log file output would be uploaded to the database on a regular basis (better than doing the database directly) and then reporting would be a much easier job.
3. We wanted logging on a per program basis and not a facility, priority basis.
4. We wanted to enforce the method of logging to be extremely uniform. It is better to use templates than to assume that the next guy will surely follow the "Failed to open file $file" rather than "Opening of file $file failed"
As far as reinventing the wheel goes, I had to - as the wheel of a jeep cannot be used in a Jaguar. :)
I haven't used this work till now in production environment. So will see how it goes.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.