Skip to Content
监控运维实践:原则与策略
book

监控运维实践:原则与策略

by Mike Julian
November 2020
Intermediate to advanced
142 pages
3h 12m
Chinese
Posts & Telecom Press
Content preview from 监控运维实践:原则与策略
应用程序监控
|
73
很多
*NIX
守护进程支持基于这些严重级别的日志输出,获取到更多还是更
少取决于设置的级别。在生产环境中设置了 DEBUG 级别而导致服务不可用的
情况很常见,因为服务中产生了大量的日志条目。
在日志中使用严重级别的弊端如下:你是基于一切都运行良好的假设来设置
它们的。当遇到迫切需要设置 DEBUG 级别的问题(棘手或困难的问题)时,
日志中没有你需要的数据,因为你可能将默认的严重级别设置为了 INFO 或
ERROR。现在你缺少迫切需要的调试数据了。
当编写自己的应用程序时,给特定的条目选择输出的严重级别会让应用程序变
得更糟糕。一个
API
连接失败应该设置的严重级别是 ERROR 还是 INFO ?如果
有健壮的限流、指数补偿、重试以及其他的缓解策略呢?这些严重级别都应
该设置为 DEBUG 吗?
正如你所看到的,严重级别是有用的,但是一定要灵活地使用它们。
与其疯狂地使日志语句充斥于每个地方,不如慢下来想想应用程序的行为表现。出现问题
时,通常你会先问哪些问题?在排除故障或只用于报告机制时,拥有哪些信息是真正有帮
助的?就从这些开始考虑吧。大体上,为一个你不完全了解的系统设置日志(或任何的监
控)是不可能的。花时间彻底地想清楚目标应用程序,你需要的日志语句(指标和告警也
是一样)就会显而易见了。
7.4.3
 写入磁盘还是写入网络
写入磁盘,并运用一个服务定期将数据发送至一个外部位置。
很多日志服务支持直接从应用程序内部将日志写入网络位置,这使得将日志转运出去用于
存储和分析变得更加容易,但随着应用程序访问的增加,这样做可能会变成一个巨大且令 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java数据科学实战

Java数据科学实战

Michael R. Brzustowicz, PhD
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115550750