Try as hard as i may, but I could not sieve through the logs due to these reasons.
- The tomcat default logs are more than 5 GB. Please can anybody tell me any machine readily available to open up those files.
- From the point above, you can imagine all possible log statements (SQL query construction, every debug/trace statements, love letters, personal bank accounts (i wish!!), XML strings) are being included.
Needless to say, I was floundering around the logs (or something that at least resembles it). Imagine the shock I got when I opened up the codes in the versioning repository and came across this all over the place
try{
// Some garbage here
.......
.......
// Some crap here
.......
.......
// Some undocumented 'only-I-know-what-I-am-doing!!' here
.......
.......
}
catch (Exception ex)
{
ex.getMessage();
}
and thats it!!! Nothing was done to the exception!!! THAT'S SIMPLY IT!!!! WTF!!!!
Some folks may claim that the glorious author of this code is pressed for time and blah blah blah ...yadda yadda yadda. (Make no mistake! This is not a one-off. It's all over the damn place!!)
PLEASE!! Who isn't??! That is not a good excuse to be a selfish, inconsiderate and downright irresponsible programmers. I am sorry but we do have ethics. Newsflash to the business/marketing/operation guys!
So are we talking about exception handling or logging here? Unless anybody can come up with a robotic artificial intelligent system that can fix itself upon exception caught, then yes, whenever an exception is generated, the least thing you can do is to log it somewhere. So they goes hand in hand sometimes.
I cannot place enough emphasis on proper logging. Whenever our application has been fully tested and deployed, we do not have the luxury of time and resources to do scoped-down testings or try to reproduce errrors. We look at logs and get the inputs and try to simulate the outputs at our localized settings. And sometimes the errors could not be reproduced localized. However the users are NOT our QA testers, nor are they our experimental guinea pigs. By introducing proper logs, we can analyze, derive the problem and come up with the fixes asap.
A nice rant here...
Application Logging - Yes it is important
I will follow up with a series on some of the key points to consider for logging.
LOL..
ReplyDeletethe author of the code is an idiot. period.
in my humble view, we probably don't really need logging during development as any errors or exceptions will be thrown at the IDE's output/debug window. BUT, the author must code the handling of exceptions and make sure it works properly so at least if the app is deployed on a test server, the QAs could at least guess what's the problem rather than getting a generic error or worst, crashing the system entirely.
but in production servers, then a logging mechanism is a necessity.
A valid point. However, as much as logging seems innocuous to developers, I still see developers log atrociously.
ReplyDeleteI guess my experience doing tier 4 support (with pager), supporting legacy systems (C/C++). There are little joy being beeped 4 am in the morning, and to look at faceless log files, that does not help anything
no more updates?
ReplyDeleteno more updates bro?
ReplyDelete