Verbose Logging Will Disturb Your Sleep

Verbose Logging Will Disturb Your Sleep

Johannes Brodwall

WHEN I ENCOUNTER A SYSTEM that has already been in development or pro- duction 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 probably be part of the monitoring. If some- thing 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 mes- sage 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, look- ing 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.

??180 97 Things Every Programmer Should Know

?

???????????????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.

时间: 2024-08-14 20:57:09

Verbose Logging Will Disturb Your Sleep的相关文章

【十三】注入框架RoboGuice使用:(Logging via Ln)

上一篇我们简单的介绍了一下RoboGuice的使用([十二]注入框架RoboGuice使用:(Your First Injected ContentProvider)),今天我们来看下Log日志使用. Android应用通过会使用内置的android.util.log在Android控制台上面打印日志信息.RoboGuice也提供了另外的日志管理,你可能会想要使用. (一):  RoboGuice日志管理和通常的Log差不多,但也同样具备以下优点: ①:对于发布包来说,Debug and ver

redhat 7.x 、redhat 6.x查看硬盘UUID方法

1.查看磁盘分区UUID: [[email protected] ~]# blkid /dev/sdb1: UUID="6bba92c4-0b25-4cc4-9442-ca87c563720a" TYPE="xfs"  /dev/sda1: UUID="21b2b922-fcb7-461f-bdc6-3bd92259f8d7" TYPE="xfs"  /dev/sda2: UUID="WC12Xe-0neg-Kmhp

10.Spring事务管理【TX】

转账案例环境搭建 1.引入JAR包 IOC的6个包 AOP的4个包 C3P0的1个包 MySQL的1个驱动包 JDBC的2个目标包 整合JUnit测试1个包 2.引入配置文件 log4j.properties+applicationContext.xml ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=

01Spring_基本jia包的导入andSpring的整体架构and怎么加入日志功能

1.什么是Spring : v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE MicrosoftInternetExplorer4 /* Style De

Rootkit Hunter恶意程序查杀

恶意程序,恶意代码检测,主要用来检测常规后门程序 下载:https://pkgs.org/search/rkhunter 安装:rpm -ivh rkunter* Installed: #需要先安装  lsof.x86_64 0:4.82-4.el6             mailx.x86_64 0:12.4-7.el6 检测系统: rkhunter -h  #查看参数 -c   #检测系统 --sk #跳过键盘输入 exp: rkhunter -c --sk [[email protect

Hibernate 自动生产表

hibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使得Java程序员可以随心所欲的使用对象编程思维来操纵数据库. 今天就来演示一下Hibernate最初级的操作,使用SchemaExport创建数据表. 1.首先建立POJO类 package com.bjpowernode.hibernate; import java.util.Date; /** * 用户 * @author Longxuan * */ public class User { pri

Shiro 入门

Apache Shiro(http://shiro.apache.org/) 是 Java 的一个安全(权限)框架. Shiro 可以非常容易的开发出足够好的应用,其不仅可以用在 JavaSE 环境,也可以用在 JavaEE 环境. Shiro 可以完成:认证.授权.加密.会话管理.与Web 集成.缓存等. 主要类介绍 Authentication:身份认证/登录,验证用户是不是拥有相应的身份:1. Authorization:授权,即权限验证,验证某个已认证的用户是否拥有某个权限:即判断用户是

MSSQL-Scripter,一个新的生成T-SQL脚本的SQL Server命令行工具

这里向大家介绍一个新的生成T-SQL脚本的SQL Server命令行工具:mssql-scripter.它支持在SQL Server.Azure SQL DB以及Azure SQL DW中为数据库生成CREATE和INSERT T-SQL脚本. Mssql-scripter是一个跨平台的命令行工具,功能等同于SQL Server Management Studio中的Generate and Publish Scripts Wizard. 咱们能够在Linux.macOS和Windows上使用它

shiro学习一

main方法代码 package com.java.shiro; import org.apache.shiro.SecurityUtils;import org.apache.shiro.authc.AuthenticationException;import org.apache.shiro.authc.UsernamePasswordToken;import org.apache.shiro.config.IniSecurityManagerFactory;import org.apach