|
1 | 1 | # Handlers, Formatters and Processors
|
2 | 2 |
|
3 | 3 | - [Handlers](#handlers)
|
| 4 | + - [Log to files and syslog](#log-to-files-and-syslog) |
| 5 | + - [Send alerts and emails](#send-alerts-and-emails) |
| 6 | + - [Log specific servers and networked logging](#log-specific-servers-and-networked-logging) |
| 7 | + - [Logging in development](#logging-in-development) |
| 8 | + - [Log to databases](#log-to-databases) |
| 9 | + - [Wrappers / Special Handlers](#wrappers--special-handlers) |
4 | 10 | - [Formatters](#formatters)
|
5 | 11 | - [Processors](#processors)
|
6 | 12 | - [Third Party Packages](#third-party-packages)
|
7 | 13 |
|
8 |
| -# Handlers |
| 14 | +## Handlers |
9 | 15 |
|
10 |
| -## Log to files and syslog |
| 16 | +### Log to files and syslog |
11 | 17 |
|
12 | 18 | - _StreamHandler_: Logs records into any PHP stream, use this for log files.
|
13 | 19 | - _RotatingFileHandler_: Logs records to a file and creates one logfile per day.
|
|
18 | 24 | - _ErrorLogHandler_: Logs records to PHP's
|
19 | 25 | [`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function.
|
20 | 26 |
|
21 |
| -## Send alerts and emails |
| 27 | +### Send alerts and emails |
22 | 28 |
|
23 | 29 | - _NativeMailerHandler_: Sends emails using PHP's
|
24 | 30 | [`mail()`](http://php.net/manual/en/function.mail.php) function.
|
|
30 | 36 | - _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
|
31 | 37 | - _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
|
32 | 38 |
|
33 |
| -## Log specific servers and networked logging |
| 39 | +### Log specific servers and networked logging |
34 | 40 |
|
35 | 41 | - _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
|
36 | 42 | for UNIX and TCP sockets. See an [example](doc/sockets.md).
|
|
47 | 53 | - _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
|
48 | 54 | - _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
|
49 | 55 |
|
50 |
| -## Logging in development |
| 56 | +### Logging in development |
51 | 57 |
|
52 | 58 | - _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing
|
53 | 59 | inline `console` messages within [FireBug](http://getfirebug.com/).
|
|
58 | 64 | - _PHPConsoleHandler_: Handler for [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef), providing
|
59 | 65 | inline `console` and notification popup messages within Chrome.
|
60 | 66 |
|
61 |
| -## Log to databases |
| 67 | +### Log to databases |
62 | 68 |
|
63 | 69 | - _RedisHandler_: Logs records to a [redis](http://redis.io) server.
|
64 | 70 | - _MongoDBHandler_: Handler to write records in MongoDB via a
|
|
68 | 74 | - _ElasticSearchHandler_: Logs records to an Elastic Search server.
|
69 | 75 | - _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
|
70 | 76 |
|
71 |
| -## Wrappers / Special Handlers |
| 77 | +### Wrappers / Special Handlers |
72 | 78 |
|
73 | 79 | - _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as
|
74 | 80 | parameter and will accumulate log records of all levels until a record
|
|
99 | 105 | - _TestHandler_: Used for testing, it records everything that is sent to it and
|
100 | 106 | has accessors to read out the information.
|
101 | 107 |
|
102 |
| -# Formatters |
| 108 | +## Formatters |
103 | 109 |
|
104 | 110 | - _LineFormatter_: Formats a log record into a one-line string.
|
105 | 111 | - _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails.
|
|
115 | 121 | - _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler.
|
116 | 122 | - _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
|
117 | 123 |
|
118 |
| -# Processors |
| 124 | +## Processors |
119 | 125 |
|
120 | 126 | - _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated.
|
121 | 127 | - _WebProcessor_: Adds the current request URI, request method and client IP to a log record.
|
|
126 | 132 | - _GitProcessor_: Adds the current git branch and commit to a log record.
|
127 | 133 | - _TagProcessor_: Adds an array of predefined tags to a log record.
|
128 | 134 |
|
129 |
| -# Third Party Packages |
| 135 | +## Third Party Packages |
130 | 136 |
|
131 | 137 | Third party handlers, formatters and processors are
|
132 | 138 | [listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
|
|
0 commit comments