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

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point 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. 查看日志