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

905 Commits

Author SHA1 Message Date
Mark Garrett
e9ea22ffeb Update to use more generic interfaces
PHP 7 can throw Errors and Exceptions, so use `Throwable` interface. `DateTimeInterface` allows for both `DateTime` and `DateTimeImmutable`.
2016-02-19 17:33:40 -06:00
Jeremy Mikola
f585e714fc Support ext-mongodb's UTCDateTime class in MongoDBFormatter
The legacy driver (i.e. ext-mongo) and MongoDate are not supported on PHP 7.
2016-01-21 16:22:47 -05:00
Jeremy Mikola
aa6ab660bd MongoDBHandler only supports ext-mongodb and mongodb/mongodb
The legacy driver (i.e. ext-mongo) is not supported on PHP 7, so there is no reason to leave behind its supporting code.
2016-01-21 15:58:45 -05:00
Will Banfield
d860b763cb Response to CR comments 2016-01-21 14:20:09 -05:00
Will Banfield
f6a9fdbb2c Add case for if manager is passed in 2016-01-21 14:19:35 -05:00
Will Banfield
ad37c8e663 Change 'save' to 'insert' in MongoDBHandler 2016-01-21 14:16:22 -05:00
Jeroen Thora
8ceda1b62e Removed unnecessary php version checks after php dependency bump to 7.0 2015-12-20 15:53:48 +01: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
b5b773e12f Fix naming conflicts in PhpConsoleHandler 2015-12-18 17:48:45 +00:00
Jordi Boggiano
906bc0e6a2 All handlers are closeable now 2015-12-18 17:48:44 +00:00
Jordi Boggiano
45323b9102 Remove BC magic getter from SwiftMailerHandler 2015-12-18 17:48:42 +00:00
Jordi Boggiano
ad37b7b2d1 Remove default handler when no handlers are set 2015-12-18 17:48:41 +00:00
Jordi Boggiano
902c0c8694 Split interfaces and base/abstract classes into more sensible pieces 2015-12-18 17:48:40 +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
Jordi Boggiano
3a41aa08c4 Docblock fixes 2015-12-18 17:48:21 +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
7e709c05f6 throwEncodeError does not return, refs #683 2015-11-18 17:57:11 +00:00
Jordi Boggiano
0178fd4f09 CS fixes, refs #683 2015-11-18 17:53:15 +00:00
Jordi Boggiano
9532e979b6 Merge remote-tracking branch 'bd808/feature/clean-json' 2015-11-18 17:50:41 +00:00
Jordi Boggiano
bc2bdedcc2 Merge pull request #676 from kornrunner/master
mongodb/mongodb support
2015-11-18 17:18:56 +00:00
Jordi Boggiano
b3f1d9a792 Add note about payload context var, refs #687 2015-11-18 17:17:24 +00:00
Jordi Boggiano
5ee8529a7a Merge pull request #687 from edvardasd/master
Pass payload information to RollbarHandler on report_message.
2015-11-18 17:14:45 +00:00
Jordi Boggiano
64f6c3d916 Adjust docblocks, refs #686 #685 2015-11-18 17:14:09 +00:00
Jordi Boggiano
0880801b4a Merge pull request #686 from apfelbox/hipchat-from
[HipChatHandler] Always send the "from" name
2015-11-18 17:12:52 +00:00
Jordi Boggiano
665453d06a Use json_encode for the whole message formatting, refs #686 2015-11-18 17:11:02 +00:00
Jordi Boggiano
c889fb2648 CS fixes & upgrading cs fixer config 2015-11-18 17:09:46 +00:00
Jannik Zschiesche
fa38530fdc Always append "from" field when sending to HipChat 2015-11-18 10:25:04 +01:00
Edvardas Daukšas
c5465b8e1a Pass payload information to RollbarHandler on report_message. 2015-11-18 10:59:57 +02:00
Jannik Zschiesche
45d243f0ab Always send the "from" name in the hipchat handler 2015-11-17 18:52:08 +01:00
fordnox
034e895a6d Do not include message levels if it is already included in tag 2015-11-15 21:23:25 +02:00
fordnox
6abfc22762 Fix Fluentd array notation to support older PHP versions 2015-11-15 20:46:26 +02:00
fordnox
a5552dd34d Add fluentd formatter. 2015-11-15 20:39:30 +02:00
Bryan Davis
6f9e221bd6 Attempt to recover from json encoding errors
Detect and attempt to recover from json_encode errors triggered by
strings containing invalid UTF-8 sequences. Recovery will only be
attempted when encoding strings or arrays. If recovery fails then
a RuntimeException will be thrown.

The recovery process will convert invalid UTF-8 codepoints as though the
input string was encoded using the ISO-8859-15 character encoding. This
conversion may result in incorrect string output if the original
encoding was not ISO-8859-15, but it will be a valid UTF-8 string.

Closes #545
2015-11-12 10:59:27 -07:00
Elan Ruusamäe
a5c56fdf1e two more minor spelling fixes 2015-11-09 18:21:29 +02:00
Elan Ruusamäe
b72866e6dd info is uncountable 2015-11-09 18:17:39 +02:00
Elan Ruusamäe
745100db42 Update NativeMailerHandler.php
don't calculate parameters in a loop
2015-11-09 11:08:56 +02:00
Boris Momčilović
4764052a10 MongoDBHandler: write: call proper method if we've got instance of MongoDB\Collection 2015-11-03 20:47:58 +01:00
Boris Momčilović
435ddc2ec6 MongoDBHandler: support for MongoDB\Client 2015-11-03 20:34:57 +01:00
Jordi Boggiano
35932023f1 Merge pull request #674 from xapon/tostring-error
#673 Fix fatal error while normalizing with __toString method
2015-10-29 19:03:56 +00:00
Jordi Boggiano
6b42e7d241 Merge pull request #668 from silvadanilo/avoid_infinite_loop
Avoid infinite loops when no data is written on a socket for a time
2015-10-28 15:18:16 +00:00
Danilo Silva
988d595351 set to 10 seconds the default timeout during writing data on a socket, to aovid possible issue and with a very low risk to break backward compatibility @Seldaek 2015-10-28 16:13:45 +01:00
Danilo Silva
65cc3083b6 exit prematurely when data has been written to avoid unnecessary time check @Seldaek 2015-10-28 16:12:09 +01:00
Jordi Boggiano
7a45682eb2 Merge pull request #671 from mtopolski/master
added param in InstrospectionProcessor __construct to allow stacktrac…
2015-10-26 20:39:03 +00:00
mtopolski
1dbc4c3b51 changed variable to be more descriptive 2015-10-26 10:20:58 -07: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
Anton Sergeyev
f19d9ce9a1 #673 Fix fatal error while normalizing with __toString method which may throw an exception 2015-10-25 22:44:00 +06:00