Monolog是php下比较全又容易扩展的记录日志组件。目前有包括Symfony 、Laravel、 CakePHP等诸多知名php框架都内置了Monolog。 Monolog可以把你的日志发送到文件,sockets,收件箱,数据库和各种web服务器上。一些特殊的组件可以给你带来特殊的日志策略。 使
Monolog是php下比较全又容易扩展的记录日志组件。目前有包括Symfony 、Laravel、 CakePHP等诸多知名php框架都内置了Monolog。
Monolog可以把你的日志发送到文件,sockets,收件箱,数据库和各种web服务器上。一些特殊的组件可以给你带来特殊的日志策略。
使用例子
1 2 3 4 5 6 7 8 9 10 11 12 |
|
核心概念
每个Logger实例都有一个通道和日志处理器栈。每当你添加一条日志记录,它会被发送到日志处理器栈。 你可以创建很多Logger,
每个Logger定义一个通道(db,请求,路由),每个Logger有很多日志处理器。这些通道会过滤日志。
每个日志处理器都有一个Formatter(内置的日志显示格式处理器)。你还可以设定日志级别。
日志级别
- DEBUG:详细的debug信息
- INFO:感兴趣的事件。像用户登录,SQL日志
- NOTICE:正常但有重大意义的事件。
- WARNING:发生异常,使用了已经过时的API。
- ERROR:运行时发生了错误,错误需要记录下来并监视,但错误不需要立即处理。
- CRITICAL:关键错误,像应用中的组件不可用。
- ALETR:需要立即采取措施的错误,像整个网站挂掉了,数据库不可用。这个时候触发器会通过SMS通知你,
github 网址https://github.com/Seldaek/monolog,官网http://monolog.ow2.org/。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.