惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

Amon's Blog

我是一个 HR,碰到疑似“外星人”,居然让我帮他修理星际飞船?! 如何在 GitHub README 中插入视频?原来这么简单 How to embed a video into GitHub-README? So easy! 十年磨一剑,今朝更锃亮:把 Hexo blog + hexo-theme-next 博客升级到最新版本 Simply way to support multiple languages i18n in Next.js 14 (Based on App Router) 一篇文章学会 Next.js 实现 i18n 国际化多语言(基于App Router) 《游子》 How to solve error on CentOS "/lib64/libstdc++.so.6 version GLIBCXX_3.4.xx not found" Hexo blog title include special symbols reports error Best Practices for Backend System Refactoring: How to do backend system refactoring efficiently and with high quality 《一个地方,人满为患》 《我》 How to solve error GitHub Permission denied fatal Could not read from remote repository 解决错误 GitHub Permission denied fatal Could not read from remote repository 《山 · 其二》 《山 · 其一》 《地铁》 写于11月27日 《中国折叠》
从优雅地查看K8s应用日志聊到日志管理
Amon Xu · 2022-10-12 · via Amon's Blog

发表于 分类于 Technology Disqus:

曾不知在哪听过一经典名句:程序员的工作有两件事,一是写 Bug,二是找 Bug。

说归说笑归笑,奈何话糙理不糙:在程序员的工作中,Bug的排查分析和解决验证确实占相当可观的一部分时间。
那么说到,而在真正排查 Bug 时,才深刻体会到另一名句:不写日志一时爽,排查 Bug 火Z场。

日志管理,一直是开发人员的老大难题。这个老大难题,大致分为几块内容:

1. 打印日志

狭义上的日志管理,也即打印日志。套用 3W1H 分析方法可以分为几个子问题:

  1. Why 为什么要打日志
    显而易见,日志是记录关键信息和数据的地方,以备未来排查问题和数据统计分析之用。

  2. What 要打什么样的日志

  3. Where/When 在哪里/什么时候打日志

  4. How 怎么打日志

2. 记录日志

3. 查看日志