SERVICE


云启未来,智造互联
企业上云升级,助力企业腾飞

日志和崩溃报告在php显示总结,logging & crash reporting in php show summary

发布时间:2017-5-13 23:13:53您的位置: > 建站百科 > 正文

日志和崩溃报告在PHP显示总结

什么是日志,为什么我们关心日志?

日志是从运行过程中收集的时间顺序事件流

日志可以产生大量的输出

日志允许我们通过告诉我们关于我们的系统的原因:

发生了什么事

当它发生

为什么会发生

我们可以用工具来帮助我们

基于查询分离相关事件

通知我们有关重要事件(例如:通过电子邮件,松弛等)

我们应该记录什么?

一般来说,登录更多而不是更少

有些事情我们不应该记录:

密码

个人资料

软件与过滤可以帮助这个

日志过多会影响性能

测井在PHP中的事实上的标准是psr-3和最常见的日志库的独白。

psr-3定义大量的日志级别。我们应该使用多少?

调试,信息,警告和错误可能是足够的大多数应用程序

我们使用的水平是基于syslog RFC

这取决于你的应用程序的规模

我们如何可视化日志?

尾- F

麋鹿堆栈是受欢迎的,快速和(相对)容易建立

Elasticsearch指标日志和使他们的搜索

Logstash整理的数据从不同的日志源

Kibana是分析数据可视化层

我们应该在哪里写日志?

平面文件和logrotate

缓冲系统像Redis或卡夫卡

将日志发送到聚合服务

Logging & Crash Reporting in PHP Show Summary
What are logs and why do we care about logging?
Logs are streams of time-ordered events collected from a running process
Logging can generate huge amounts of output
Logs allow us to reason about our systems by telling us:
What is happening
When it is happening
Why it is happening
We can use tools to help us to
Isolate relevant events based on queries
Notify us about important events (e.g: by email, slack, etc)
What should we log?
In general, log more rather than less
There are some things we should not log:
Passwords
Personal data
Software with filtering can help with this
Logging too much can impact performance
The de-facto standard for logging in PHP is PSR-3 and the most common logging library is monolog.

PSR-3 Defines a lot of log levels. How many should we use?
DEBUG, INFO, WARNING and ERROR is probably enough for most apps
The levels we use are based on the syslog RFC
It depends on the scale of your application
How can we visualize logs?
tail -f
The ELK Stack is popular, fast and (relatively) easy to set up
Elasticsearch indexes logs and makes them searchable
Logstash collates the data from different log sources
Kibana is the visualization layer for analyzing the data
Where should we write logs?
Flat files and logrotate
A buffering system like Redis or Kafka
Send logs to an aggregation service

梦之网科技
本文网址:http://www.mzwkj.com/baike/874.html

济南梦之网科技:济南网站建设,济南网站设计公司,网站建设开发公司,专业网站制作公司,拥有专业的技术团队,一流的服务团队.专业团队为您提供网站设计,网站定制服务,公众号应用开发,微信小程序开发,为用户提供成套解决方案,智能农业物联网系统

您可能感兴趣