1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 17:46:09 +02:00
Commit Graph

51 Commits

Author SHA1 Message Date
Jordi Boggiano
c5853b9b0f Improve build 2020-12-09 16:39:34 +01:00
Mponos George
a54cd1f178 Replace call_user_func 2020-07-08 23:02:57 +03:00
Mponos George
53e2c97b0b Static analysis improvements (#1475)
* Static analysis improvements

* Fix review issues
2020-07-08 21:40:29 +02:00
Jordi Boggiano
ae84612017 Merge branch '1.x' 2019-11-11 18:34:16 +01:00
Jordi Boggiano
65f1f304d4 Add forwarding of formatter functions to nested handlers in Sampling, Filter and FingersCrossed handlers, and fix handling of callable factory handler config, fixes #1386, closes #1387 2019-11-11 18:21:38 +01:00
George Mponos
61021a535d Added missing bubble property 2018-12-09 21:32:59 +02:00
Jordi Boggiano
1c5b0b8ff4 Update return types 2018-11-19 14:40:54 +01:00
Jordi Boggiano
e07c948042 Merge branch '1.x', clean up close/reset for 2.0, refs #997 2018-11-04 22:41:52 +01:00
Jordi Boggiano
b80352368c Add Logger::close and clarify what close and reset do plus 2018-11-04 22:15:25 +01:00
Jordi Boggiano
dddc7ed781 Fix some resettableinterface usages 2018-11-04 19:58:13 +01:00
Jordi Boggiano
073c5d763a Merge branch '1.x' 2018-11-04 18:40:32 +01:00
Grégoire Pineau
0625068bf0 Added a new ResettableInterface and implemented it where possible.
When one use Monolog in a long process like an AMQP worker with a
`FingersCrossedHandler` or `BufferHandler` there is a drawback: as soon as there
is an AMQP message that generate a log >= error (for example), all next AMQP
messages will output logs, even if theses messages don't generate log where
level >= error.

In the same context there is a drawback for processor that add an UUID to the
logs. The UUID should change for each AMQP messages.

---

This patch address this issue with a new interface: `ResettableInterface` interface.
Side note: `reset()`, `flush()`, `clear()`,  are already used in Monolog. So
basically, one can use the `reset()` on the `Logger` and on some
`Handler`s / `Processor`s.

It's especially useful for

* the `FingersCrossedHandler`: it `close()` the buffer, then it `clear()` the buffer.
* the `BufferHandler`: it `flush()` the buffer, then it `clear()` the buffer.
* the `UidProcessor`: it renew the `uid`.
2018-07-06 16:07:13 +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
bd7b28e5ee Merge branch '1.x' 2018-06-07 18:49:40 +02:00
Erik Booij
ecdfdc9897 Rename Boolean in phpDocs to bool 2017-11-04 12:14:41 +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
3eee2a006b Merge branch '1.x' 2016-05-20 19:40:36 +01:00
Nils Adermann
0fc6734c6f FingersCrossedHandler: Clean up code 2016-04-20 15:00:33 -04:00
Nils Adermann
abb58081fe Extract fingerscrossed activation into its own method callable from outside 2016-04-15 14:05:55 -04:00
Nils Adermann
c677398c76 Provide means to manually activate a FingersCrossedHandler
This is useful if you have a FingersCrossedHandler set up and some where
in your application are interested in all output regardless of whether
the threshold is actually reached. For example to temporarily debug some
problem. One can replace the handler in that spot, but this is
signifcantly easier to use.
2016-04-14 16:56:59 -04: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
902c0c8694 Split interfaces and base/abstract classes into more sensible pieces 2015-12-18 17:48:40 +00:00
Reinier Kip
162c30768d Allow PSR-3 passthru level in FingersCrossedHandler. 2015-05-11 13:26:40 +02:00
Jordi Boggiano
9b350bb1fd Move handler checks in constructor 2014-12-28 17:31:31 +00:00
Jordi Boggiano
55b60344a8 Adds FingersCrossedHandler::clear and BufferHandler::clear, fixes #390 2014-07-28 20:45:50 +02:00
Jordi Boggiano
6397b5883b CS fixes 2014-07-28 20:40:43 +02:00
David Simon
b1216b8d45 Allowing some messages to always be flushed from FingersCrossedHandler 2014-05-27 11:26:42 -04:00
Jordi Boggiano
050bb52fd8 Fix a few details and add docs to the ChannelLevelActivationStrategy, refs #186 2013-07-17 18:11:27 +02:00
Jordi Boggiano
5feb21ae1a Fix Buffer, Group and FingersCrossed handlers to make use of their processors, fixes #170 2013-03-17 19:36:02 +01:00
Jordi Boggiano
30b48f1231 Enforce the handler is callable before calling it 2012-11-04 17:37:56 +01:00
Jordi Boggiano
49143f3d11 s/callback/callable/g 2012-11-04 17:37:25 +01:00
Jordi Boggiano
da33c84d07 CS fixes 2012-06-14 15:47:01 +02:00
Johannes M. Schmitt
8ee130dd24 made change BC 2012-03-21 20:16:42 -06:00
Johannes M. Schmitt
8cdc9c6e10 extracted activation logic from FingersCrossedHandler 2012-03-19 01:55:18 -06:00
Jordi Boggiano
6a2d207f98 Bubbling defaults to true 2011-06-10 16:03:47 +02:00
Christophe Coevoet
0defabb726 Refactored the AbstractHandler to avoid having some dummy write() methods 2011-05-11 18:43:04 +02:00
Christophe Coevoet
a75f7963ee Added the possibility to configure whether the FingersCrossedHandler should continue to buffer after being triggered or not
The change is BC as the default is to stop buffering.
2011-05-07 01:28:00 +02:00
Christophe Coevoet
9b084240e9 Changed FingersCrossedHandler to use handleBatch when the buffer is triggered 2011-05-07 01:19:54 +02:00
Christophe Coevoet
3cb3dbdc8f Made the write method protected
Tests are not a good reason to make it public.
2011-04-06 13:22:06 +02:00
Christophe Coevoet
87332a3e4e Added phpdoc for all methods and added the typehint for the FormatterInterface 2011-04-06 00:50:18 +02:00
Jordi Boggiano
e20fd0cc08 Minor fixes to merged commit 2011-04-05 10:42:22 +02:00
Christophe Coevoet
e32886e26f Fixed callback factory for the FingersCrossedHandler 2011-04-05 10:29:08 +02:00
Christophe Coevoet
3a3c96d6d7 Added some methods in the HandlerInterface and some typehints 2011-03-19 23:07:44 +01:00
Jordi Boggiano
6c24217c56 Renamed message to record 2011-02-25 23:01:43 +01:00
Jordi Boggiano
903bbd0fd6 Move the stack handling to the Logger class 2011-02-25 22:00:51 +01:00
Jordi Boggiano
f4e85e9412 Fixed typo 2011-02-24 22:12:23 +01:00
Jordi Boggiano
811e6c79d6 Added docblocks and fixed a couple tests 2011-02-22 12:10:54 +01:00
Jordi Boggiano
228af6a6cd Documented and tested FingersCrossedHandler 2011-02-20 22:40:45 +01:00
Jordi Boggiano
89a447e135 Fixed typo 2011-02-20 21:48:14 +01:00