Verbose Logging Will Disturb Your Sleep
来源:互联网 发布:简述什么是移动云计算 编辑:程序博客网 时间:2024/06/18 18:46
When I encounter a system that has already been in development or production for a while, the first sign of real trouble is always a dirty log. You know what I'm talking about. When clicking a single link on a normal flow on a web page results in a deluge of messages in the only log that the system provides. Too much logging can be as useless as none at all.
If your systems are like mine, when your job is done someone else's job is just starting. After the system has been developed, it will hopefully live a long and prosperous life serving customers. If you're lucky. How will you know if something goes wrong when the system is in production, and how will you deal with it?
Maybe someone monitors your system for you, or maybe you will monitor it yourself. Either way, the logs will be probably part of the monitoring. If something shows up and you have to be woken up to deal with it, you want to make sure there's a good reason for it. If my system is dying, I want to know. But if there's just a hiccup, I'd rather enjoy my beauty sleep.
For many systems, the first indication that something is wrong is a log message being written to some log. Mostly, this will be the error log. So do yourself a favor: Make sure from day one that if something is logged in the error log, you're willing to have someone call and wake you in the middle of the night about it. If you can simulate load on your system during system testing, looking at a noise-free error log is also a good first indication that your system is reasonably robust. Or an early warning if it's not.
Distributed systems add another level of complexity. You have to decide how to deal with an external dependency failing. If your system is very distributed, this may be a common occurrence. Make sure your logging policy takes this into account.
In general, the best indication that everything is all right is that the messages at a lower priority are ticking along happily. I want about one INFO-level log message for every significant application event.
A cluttered log is an indication that the system will be hard to control once it reaches production. If you don't expect anything to show up in the error log, it will be much easier to know what to do when something does show up.
By Johannes Brodwall
This work is licensed under a Creative Commons Attribution 3
- Verbose Logging Will Disturb Your Sleep
- Verbose Logging Will Disturb Your Sleep
- If you sleep now,you will have a dream. If you study now,you will achieve your dream.
- Guy,Keep your hair on .Whatever will be ,will be.
- turned on verbose logging for linking and checked to see if anything suspicious is going on
- Seven Questions That Will Change Your Life
- 5 Questions That Will Change Your Life
- Retargeting Will Feature in Your Future
- Add logging to your Java applications
- 5 Techniques to Improve Your Server Logging
- Top Ten Reasons Why XQuery 2005 Will Change Your Life
- Will you hold hands of your lover when disaster comes?
- 15 reasons why Sybase will be in your future
- 7 Things Your Employees Will Never Tell You
- Data compression on Hbase will make your mapreduce job fly
- Your MATLAB license will expire in 05 days
- Your MATLAB license will expire in 05 days
- Your iOS Distribution Certificate will expire in 30 days
- The Unix Tools Are Your Friends
- Ubuntu11.04安装JDK7
- eclipse中默认js编辑器非常慢,尤其在拷贝粘贴代码时的解决方法
- Use the Right Algorithm and Data Structure
- 谷歌不在关注WebKit了,正在研发新浏览器内核Blink
- Verbose Logging Will Disturb Your Sleep
- WET Dilutes Performance Bottlenecks
- A Model of Learning Objectives[一种学习目标模型]
- 微软推出新款日历服务 功能和界面均有完善
- When Programmers and Testers Collaborate
- Write Code as If You Had to Support It for the Rest of Your Life
- 苹果面临10大威胁:法律官司缠身 创新减少
- Write Small Functions Using Examples
- Spring与Mybatis三种常用整合方法