1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 10:06:08 +02:00
Commit Graph

119 Commits

Author SHA1 Message Date
Jordi Boggiano
334b8d8783 More type hints on some handler classes 2018-07-18 09:55:49 +02:00
Jordi Boggiano
06143b03e5 Add a bunch of return types and fix type inconsistencies reports from phan 2018-07-04 14:14:08 +02:00
Jordi Boggiano
41b8f5ebf4 CS fixes 2018-06-18 18:53:46 +02:00
Jordi Boggiano
96684bfb22 Merge pull request #1038 from EnoahNetzach/patch-1
Remove misleading reference to RFC 5424 standard
2018-06-17 16:21:33 +02:00
Jordi Boggiano
ff5ae5cead Merge branch '1.x' 2018-06-11 17:35:32 +02:00
Jordi Boggiano
120c434db9 Verify handlers types, fixes #1131 2018-06-11 17:30:42 +02:00
Jordi Boggiano
1802e5ab25 Docblock improvements, fixes #1155 2018-06-08 21:58:29 +02:00
Jordi Boggiano
12c9f58de2 Merge branch '1.x' 2018-06-08 21:08:04 +02:00
Jordi Boggiano
6d79e51f91 Tweaks to exception handler, refs #1012 2018-06-08 21:02:44 +02:00
Jordi Boggiano
4814446331 Merge remote-tracking branch 'vincepare/1.x' into 1.x 2018-06-08 20:44:28 +02:00
Jordi Boggiano
bd7b28e5ee Merge branch '1.x' 2018-06-07 18:49:40 +02:00
Jordi Boggiano
8c4539f1fe More boolean=>bool 2018-06-07 18:45:07 +02:00
Erik Booij
ecdfdc9897 Rename Boolean in phpDocs to bool 2017-11-04 12:14:41 +01:00
Fabrizio Castellarin
c7eb1a0f75 Remove misleading reference to RFC 5424 standard 2017-08-10 15:40:55 +02:00
Vincent Paré
207c91699e Custom exception handler (#500)
Add custom exception handler to let the user change the default
behavior when Monolog raise an exception while logging a record.
2017-07-14 12:18:44 +02:00
Jordi Boggiano
7405bb5d67 CS fixes 2017-03-20 10:56:47 +01:00
Jordi Boggiano
d9462d50b0 Merge pull request #936 from zerkms/MICRO_OPT_FOREACH_INSTEAD_OF_CURRENT/NEXT
Replaced current/next-style loop with foreach
2017-03-17 23:08:00 +01:00
Jordi Boggiano
59d3df2f38 Add comment note for clarity 2017-03-17 23:07:49 +01:00
Ivan Kurnosov
c411ad174c Changed the "rewind loop condition" operand
The `$handlerKey` might be a slightly more readable choice here
2017-03-13 09:06:46 +13:00
Ivan Kurnosov
f697ec7c96 Move human readable level name resolution in Logger::addRecord() to as late as possible (#934) 2017-03-12 17:51:16 +01:00
Ivan Kurnosov
9e43ef06d8 Minor code readability improvement 2017-02-27 15:43:21 +13:00
Ivan Kurnosov
7f7d5e1f44 Replaced current/next-style loop with foreach 2017-02-27 15:33:55 +13:00
Jordi Boggiano
8f47e12463 Fix PHP7.1 DateTime support 2016-11-17 11:25:45 +01:00
Jordi Boggiano
4a43d9b17c Fix microseconds support on 7.1, and enable it by default as 7.1 has no perf cost anymore 2016-11-14 11:53:15 +01:00
Jordi Boggiano
5ce1c921ad Fix type errors, thanks phan 2016-09-25 22:11:37 +02:00
Jordi Boggiano
6e6586257d Add scalar types to processor/formatters and top level classes 2016-09-25 21:23:35 +02:00
Jordi Boggiano
760dc44ebd Remove redundant setTimezone call 2016-09-25 18:39:28 +02:00
Jordi Boggiano
96f4fd718f CS fixes 2016-09-25 17:46:38 +02:00
krzysiekpiasecki
4ebf6fa43f Declaring That a Logger Can Throw an Exception 2016-08-29 20:46:48 +02:00
Jordi Boggiano
7efec0eeab Fix timezone param handling 2016-06-25 16:46:53 +01:00
Jordi Boggiano
21dde4dedb Move to strict mode and fix tests 2016-05-27 13:44:00 +01:00
Jordi Boggiano
f200e79879 CS fixes 2016-05-26 20:54:06 +01:00
Jordi Boggiano
912d813c73 Add our own DateTime implementation to provide nicer JSON output, fixes #736 2016-05-20 21:33:27 +01:00
Jordi Boggiano
e27225dc40 Switch to DateTimeImmutable everywhere 2016-05-20 20:55:31 +01:00
Jordi Boggiano
2a569ff961 Disable microsecond precision by default 2016-05-20 20:25:27 +01:00
Jordi Boggiano
a00acb6022 Clarify var purpose 2016-05-20 19:47:45 +01:00
Jordi Boggiano
f1091c3b97 CS fixes 2016-03-01 18:12:45 +00:00
Jordi Boggiano
ba995ffd1e Merge branch '1.x' 2016-03-01 17:15:43 +00:00
Jordi Boggiano
cb2778ae77 Add ->withName to clone a handler and get a new name, fixes #730 2016-02-13 16:47:31 +00:00
Jordi Boggiano
6c424f851c Add a lot more scalar types and go strict in Logger 2015-12-18 17:48:48 +00:00
Jordi Boggiano
ad37b7b2d1 Remove default handler when no handlers are set 2015-12-18 17:48:41 +00:00
Jordi Boggiano
39f8a20e6d Remove non-PSR-3 methods for adding log records 2015-12-18 17:48:38 +00:00
Jordi Boggiano
35ce15e098 Bump Monolog\Logger::API version 2015-12-18 17:48:37 +00:00
Jordi Boggiano
6505e02fd3 Change timezone to be per-instance and not global 2015-12-18 17:48:36 +00:00
Robbie Averill
ea2bef43a9 DRY: Use constants for level codes instead of re-defining 2015-12-16 09:34:12 +13:00
Jordi Boggiano
cab3ff71ff Add regression test for #691 and optimize implementation using a single pass loop over the handlers, refs #692 2015-11-26 23:48:42 +00:00
Matt Johnson
73876ace65 Changed iterating over the $handlers array to allow for correct sequential processing regardless of array containing indexed numerical keys, or associative string keys in the array.
It iterates over the entire array until it finds the $handlerKey that was identified earlier using isHandling(). Once the starting position is found it will execute handle() on each handler unless a handler returns true indicating the handler completed the processing of the record, bubbling to the next handler should not occur, and the loop breaks.

This fixes an issue where an associative array of handlers is passed into the Logger constructor when instantiated.
magento/magento2#2529
Seldaek/monolog#691
2015-11-26 02:33:02 -06:00
Jordi Boggiano
c889fb2648 CS fixes & upgrading cs fixer config 2015-11-18 17:09:46 +00:00
Bryan Davis
4e69837afc Optionally reduce timestamp resolution for performance
Introduce a new `useMicrosecondTimestamps()` method to Logger that
allows runtime selection of whether or not to create microsecond
resolution timestamps for log records.

Generating microsecond resolution timestamps by calling
`microtime(true)`, formatting the result via `sprintf()` and then
parsing the resulting string via `DateTime::createFromFormat` can incur
a measurable runtime overhead vs simple usage of `new DateTime` to
capture a second resolution timestamp in systems which generate a large
number of log events.

The default behavior of generating high precision timestamps remains the
same, but may be changed in a future release. Users requiring high
precision timestamps are encouraged to explicitly call
`Monolog\Logger::useMicrosecondTimestamps(true)` in their setup code.

Closes #657
2015-10-25 15:13:43 -06:00
Jordi Boggiano
419ca7ac25 Tweak patch a bit, refs #617 2015-08-09 18:28:21 +01:00