1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-19 15:49:19 +02:00
Commit Graph

40 Commits

Author SHA1 Message Date
Jordi Boggiano
12c9f58de2 Merge branch '1.x' 2018-06-08 21:08:04 +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
ca4ffa68f6 Use namespaced phpunit classes, fixes #983 2017-06-19 00:48:54 +02:00
Sam-Burns
fa5d07f86f Skipping DateTime microsecond test in PHP 7.1.3, because of https://bugs.php.net/bug.php?id=74258 2017-04-01 21:52:18 +01: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
c6a9f28e24 Fix a ton of tests for latest phpunit and turn faked-stream tests into real network tests with a local server 2016-09-19 18:20:42 +02:00
Jordi Boggiano
89683faff3 Fixes microsecond timezone support, fixes #832 2016-09-19 13:24:54 +02: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
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
39f8a20e6d Remove non-PSR-3 methods for adding log records 2015-12-18 17:48:38 +00:00
Jordi Boggiano
6505e02fd3 Change timezone to be per-instance and not global 2015-12-18 17:48:36 +00: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
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
Sam Minnee
60c96cfa2a Added Logger::setHandlers()
Logger::setHandlers() is intended to help dependency injection systems
that deal more elegantly with property setters than constructor
arguments. Alongside getHandlers(), pushHandler(), popHandler(), it is
a logical addition to the API.

It also attempts to address some possible errors in the format of the
data passed:

 - If a map is passed, the keys are removed, as these aren’t expected
   by Monolog
 - If falsey values are included, these are stripped

It relies on Logger::pushHandler() internally, so that if any special
behaviour is added in the future, this only needs to be added in one
place.
2015-07-28 13:15:02 +12:00
Jordi Boggiano
8c4b1be4a2 Change Logger::setTimezone to accept a DateTimeZone object, refs #566 2015-06-01 21:15:07 +01:00
Bryan Davis
5d7db08106 Add Logger::setTimezone()
Add a setter method to allow changing the timezone used when creating
new log records. This provides a means to correct a behavioral change
introduced by 6cbdc04 where use of the PHP runtime default timezone
provided by `date_default_timezone_get()` was introduced. In most
environments the new default behavior is preferable, but if an
application allows the default timezone to vary between requests it
causes confusing log output.
2015-05-20 22:05:03 -06:00
Reda Bouchaala
2cb4a57490 Removed Logger::toMonologLevel() code duplication and added relevant tests 2015-04-25 19:42:19 +01:00
Jordi Boggiano
392ef35fd4 CS fixes 2014-03-23 20:50:26 +01:00
Jordi Boggiano
9f515d47ce Add possibility to pass handlers/processors to Logger::__construct, fixes #157 2013-02-13 19:06:07 +01:00
Jordi Boggiano
9c8db38385 CS fixes 2012-12-14 12:15:30 +01:00
Jordi Boggiano
b23cfd3d6c Throw an exception on invalid level name 2012-11-14 16:46:10 +01:00
Jordi Boggiano
61359a972b Merge remote-tracking branch 'FGM/master' 2012-06-19 20:28:04 +02:00
Jordi Boggiano
da33c84d07 CS fixes 2012-06-14 15:47:01 +02:00
Frederic G. MARAND
07aac12c72 Implement the 8 RFC3164 severity levels instead of just 6.
- constants defined for the 2 missing levels: NOTICE and EMERGENCY.
- add<level>() and <level>() convenience methods added.
- TestHandler and tests updated to account for the two extra levels.
- surjective mappings from the RFC3164 to only 6 levels changes to bijective.
- README updated accordingly.
2012-05-28 20:29:27 +02:00
Jordi Boggiano
355123d607 Add isHandling, fixes #53 2012-01-28 14:43:55 +01:00
Christophe Coevoet
64009a5880 Added more tests for the logger 2011-09-06 23:37:29 +02:00
Christophe Coevoet
10e5ecd409 Added some tests 2011-08-29 15:00:28 +02:00
Artem Nezvigin
f31388ec42 Added logger name getter, Monolog\Logger::getName()
Added phpunit.xml to .gitignore to prevent contributors from accidentally commiting theirs.
2011-08-07 16:29:10 -07:00
Jordi Boggiano
66c1cc05a8 More testing coverage 2011-06-29 21:32:02 +02:00
Jordi Boggiano
38862439a0 Improved coverage of Logger 2011-06-29 18:58:56 +02:00
Jordi Boggiano
a426ce2815 Added a Processor stack to the Logger class, added getHandler() to check if any handler is going to handle the message before processing it, handlers are now calling their parent in a chain 2011-02-21 20:38:18 +01:00
Jordi Boggiano
3fa6e4b91f Major refactoring to follow the Logbook model 2011-02-20 20:53:11 +01:00
Jordi Boggiano
7239b5203b Added tests, fixed a bunch of bugs 2011-02-17 03:04:37 +01:00