"A fool can ask more questions that a thousand wise monks can answer"
But to answer your question, I use logging for:
Reporting
If you want to know how many people visited your website, you let your web server log the connections in a log file and you use a statistics program to show you how many visitors you had per day, per month, from which area in the world, at what time of the day, etc. etc. All of this would be impossible without logging.
Debugging
Especially as a developer, you sometimes want to know what state your program is in at a particular time. You can use a debugger for that, but in some cases that is not possible or not a usable situation. One way of telling the outside world about the state of your program, is to sprinkle the code with logging statements. These can be as easy as warn statements that you add and remove when the program is production ready. Or they can be more permanent when using a logging tool such as log4perl.
Coming back to log4perl. I haven't used it (yet), but I am tempted. I only have 2 points against log4perl that I inherintly dislike:
- the runtime overhead, even if not logging
- the export of symbols to the namespace of the program (e.g. $DEBUG)
Hope this helps.
Liz