1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 13:16:39 +02:00

898 Commits

Author SHA1 Message Date
Jordi Boggiano
467e764fb6 Fix gelf message formatter failing to handle context/extra numeric keys, fixes #1932 2025-03-16 14:04:36 +01:00
Markus Staab
7ca003e6ae Rename TestCase to MonologTestCase (#1953) 2025-03-16 13:30:20 +01:00
Markus Staab
9d6bcfc94d Fix build (#1954)
* Fix build

* Update phpstan-baseline.neon

* better fix
2025-03-16 13:24:42 +01:00
Rajmund
45b5e0e33e Change datetime format from ISO 8601 to ATOM in ElasticsearchFormatter and related tests (#1942) 2025-03-15 14:23:08 +01:00
Andrii Shevchenko
c8bbe52af5 added possibility to set child handler after instantiation (#1946) 2025-03-15 14:19:21 +01:00
Jeff W
9cfd246982 Add a mail() hook to NativeMailHandler. (#1948)
Allows subclassing NativeMailHandler so that the call to mail()
can be intercepted and replaced in cases where additional processing
needs to happen.

Tests are mostly updated to use this method to test sent messages,
but one test is added to make sure that everything gets passed through
intact.

Co-authored-by: JDW <xs@jdw.sx>
2025-03-15 14:17:54 +01:00
Jordi Boggiano
074503850b Remove empty lines if a custom stack trace parser returns null, fixes #1925 2024-12-05 18:02:26 +01:00
Ruud Kamphuis
a258e4fe90 Deprecate DateTimeImmutable (#1928)
Fixes #1926
2024-12-05 15:38:02 +01:00
Jordi Boggiano
24a1110715 Merge branch '2.x' 2024-11-11 20:15:35 +01:00
Jordi Boggiano
0779fb91e5 Close and reopen file handles if a write fails (#1882)
* Close file handle after each write, refs #1862, refs #1860, refs #1634

* Modify patch to retry writes once if they fail, then throw if not

* Fix php7.2 build
2024-11-11 20:08:58 +01:00
Jonathan Plantey
5d5da57b81 Normalize call normalizeRecord if necessary (#1906)
* Normalize call normalizeRecord if necessary

* Update patch to always go through format()

* Update JsonFormatterTest.php

* Fix implementation

* Fix test expectations

* Update JsonFormatter.php

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-11-11 15:34:03 +01:00
Jordi Boggiano
f43e3d5637 Upgrade phpstan, phpunit (#1923)
* Upgrade phpstan, phpunit

* Fix phpunit deprecation

* Fix hg tests

* Fix php-console tests

* Fix phpunit on 8.1

* Bump phpconsole
2024-11-11 15:21:55 +01:00
Jordi Boggiano
7b5a792204 Restore rollbar test suite 2024-11-11 10:02:18 +01:00
Steven Lewis
e5b3586456 Fix PHP 8.4 E_STRICT deprecation notices (#1921) 2024-11-09 14:27:28 +01:00
Jordi Boggiano
a4a5a06501 Fix deprecations 2024-08-27 09:45:47 +02:00
Jordi Boggiano
6772a39c03 Merge branch '2.x' 2024-08-27 09:42:11 +02:00
Jordi Boggiano
23560e32b1 Update CI (#1909)
* Update CI

* Fix deprecation warning

* Fix types
2024-08-27 09:31:25 +02:00
Jordi Boggiano
07cd08e0e4 Fix CS 2024-06-28 10:48:40 +02:00
Christoph Dreis
3ba77d1d39 Use fully-qualified name for native functions (#1887) 2024-06-28 10:45:25 +02:00
Jonathan Campbell
4e03d25f6d Fix IntrospectionProcessor tests that were not validating the code under test (#1896)
Three tests in IntrospectionProcessorTest (testLevelTooLow, testLevelEqual, testLevelHigher) aren't actually testing anything. Because `$expected = $input` is a reference, the changes made to `$expected['extra']` are made to $input and carried forward to $actual. You can demonstrate this by adding a `return $record` at the immediate start of `InstrospectionProcessor::__invoke` -- the tests still pass despite bypassing all the code.
2024-06-28 10:41:10 +02:00
Jordi Boggiano
47e301d3e2 Also add setBasePath to NormalizerFormatter/JsonFormatter 2024-06-28 10:39:13 +02:00
Jordi Boggiano
a4471eb05b Merge branch '2.x' 2024-04-15 11:22:23 +02:00
Jordi Boggiano
884aa47a05 Fix json formatter handling of incomplete classes, fixes #1834 2024-04-15 10:56:50 +02:00
Jordi Boggiano
84638a5926 Add test for setBasePath functionality, refs #1873 2024-04-12 22:41:20 +02:00
Jordi Boggiano
613eaea74b Fix group annotations 2024-04-12 17:30:46 +02:00
Jordi Boggiano
b127292ee0 Fix phpunit deprecations 2024-04-12 17:26:33 +02:00
Jordi Boggiano
cdec3b52ad Merge branch '2.x' 2024-04-12 15:36:24 +02:00
Jordi Boggiano
d1422610e9 Fix PHP 8.4 build error 2024-04-12 13:43:28 +02:00
Witold Wasiczko
35dab43e3c Include extra in context in PsrHandler (#1852) 2024-04-12 11:00:56 +02:00
Vincent Langlet
c4ba76aeae Avoid throwing an exception when the toString fails (#1868) 2024-04-12 10:47:57 +02:00
Cosmin Ardeleanu
b0f4bf7eb7 Fix LogRecord "extra" data leaking between handlers (#1819)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2023-10-27 16:54:39 +02:00
Jordi Boggiano
8ff4ab5c94 Add ability to indent stack traces in LineFormatter, fixes #1835 2023-10-27 16:19:09 +02:00
Jordi Boggiano
5d317e2c6f Fix tests usage 2023-10-27 16:09:14 +02:00
Philipp Müller
1feb860c33 Added possibility to set max length for level name in LineFormatter
Closes #1850
2023-10-27 16:07:36 +02:00
Jordi Boggiano
70f6ca05b9 Merge branch '2.x' 2023-10-27 15:26:39 +02:00
Grégoire Pineau
f54263935d Skip mongodb extension if extension is not installed (#1825) 2023-10-27 14:50:45 +02:00
dong
8813064010 Let indexed arrays to support inline linebreaks in LineFormatter (#1818) 2023-10-27 14:31:42 +02:00
Egor Korobov
ed80d53ab2 Fix fatal error in NormalizeFormatter: method_exists(): The script tried to execute a method or access a property of an incomplete object.
Closes #1833
Fixes #1834
2023-10-27 14:05:53 +02:00
Christophe Coevoet
e545d0f444 Add a WithMonologChannel attribute (#1847)
This attribute is meant to be used by frameworks / integrations to
choose which logger instance to inject in a class when they manage
several channels, if they decide to use it.
This attribute will have no effect in Monolog itself as the wiring of
the logger in other classes is not managed by Monolog.
2023-10-25 15:02:25 +02:00
Samson Endale
1fd8e8c2c7 Add TelegramBotHandler topics support (#1802) 2023-06-20 16:42:38 +02:00
Roy
4356885fbb Add support for priority in the Monolog bundle (https://github.com/symfony/monolog-bundle/pull/455) (#1797)
Co-authored-by: Roy <rdmartines@vcn.nl>
2023-06-20 16:37:16 +02:00
Johan Vlaar
dc4bc7e660 Add LoadAverageProcessor (#1803)
Co-authored-by: johan Vlaar <johan@adivare.nl>
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2023-06-20 16:13:13 +02:00
chris
8561130215 Upgrade to phpunit 10 (#1806)
Co-authored-by: Christopher Georg <christopher.georg@sr-travel.de>
2023-06-20 15:56:11 +02:00
Pitchaya Boonsarngsuk
06276fcf77 FingersCrossedHandler fix passthruLevel checking (Fixes #1800) (#1801) 2023-06-20 14:19:37 +02:00
Jordi Boggiano
9b5daeaffc Merge branch '2.x' 2023-02-06 14:46:10 +01:00
Jordi Boggiano
c8b1e0e789 Fix serialization implementation 2023-02-06 14:43:38 +01:00
Jordi Boggiano
2ae044482c Fix serializability of Logger class, fixes #1792 2023-02-06 14:33:41 +01:00
Identei
f58e4f47b3 Add an option to set the op_type for the ElasticsearchHandler (#1766)
Co-authored-by: Identei <>
2023-02-04 21:40:17 +01:00
Jordi Boggiano
c424dbc6a5 Merge branch '2.x' 2023-02-04 16:24:57 +01:00
Niklas Keller
0f014206a4 Fix cycle detection within fibers (#1753)
* Fix cycle detection within fibers

We keep a separate depth count per fiber.

Fixes #1752.

* Avoid additional call to Fiber::getCurrent()

Suppresses phpstan errors, as they're false positives.
2023-02-04 15:49:17 +01:00