1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 10:50:21 +02:00

816 Commits

Author SHA1 Message Date
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
Jordi Boggiano
23560e32b1 Update CI (#1909)
* Update CI

* Fix deprecation warning

* Fix types
2024-08-27 09:31:25 +02:00
Jordi Boggiano
884aa47a05 Fix json formatter handling of incomplete classes, fixes #1834 2024-04-15 10:56:50 +02:00
Jordi Boggiano
d1422610e9 Fix PHP 8.4 build error 2024-04-12 13:43:28 +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
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
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
Luís Cobucci
e937256eee Fix date/time field for GCP logging (#1758)
We introduced the formatter using the incorrect field, which was making GCP not to extract the correct value from the payload.

This uses the field that actually maps to the expected format.

More info: https://cloud.google.com/logging/docs/structured-logging
2023-02-04 15:38:57 +01:00
Jordi Boggiano
6a28e9d41a Use facility additional value and not channel to be compat with existing Monolog 3 code 2022-08-20 15:05:05 +02:00
Jordi Boggiano
5eccd17dc5 Add graylog2/gelf-php 2.x support, fixes #1747 2022-08-20 14:09:11 +02:00
Jordi Boggiano
132eace138 Fix build 2022-08-02 15:03:47 +03:00
Jordi Boggiano
4b4fad9476 Fix serialization to include private properties, fixes #1727, fixes phpro/grumphp#1020 2022-07-22 20:49:07 +02:00
Lusso Luca
ffd505543c Add RFC 5424 level (7 to 0) support to Logger::log and Logger::addRecord, fixes #1686 (#1723)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2022-07-22 16:46:43 +02:00
Pavel Bychko
320909a1d1 Fix replaceNewlines method to avoid replacing escaped backslashes, closes #1721, fixes #1720 2022-07-22 16:05:32 +02:00
Jordi Boggiano
cf0f4b3814 Handle __toString to serialize objects which are not json-serializable in JsonFormatter, fixes #1733 2022-07-22 15:27:46 +02:00
Jordi Boggiano
34635fdcf5 Add docs 2022-07-22 15:08:12 +02:00
Jordi Boggiano
6fdeea463c Fix build 2022-07-22 15:07:44 +02:00
erikn69
27dc1b2ef7 Fix utf8_encode deprecation (#1722) 2022-07-22 14:23:53 +02:00
Luís Cobucci
197f534d42 Add basic support to Google Cloud Logging format (#1719)
Google Cloud Logging doesn't show the correct level log when using
JsonFormatter, making observability a bit trickier. This applies minor
tweaks to the default format, allowing log entries to be properly
represented.

There are alternative packages to this but they add fields that aren't
strictly required - also performing `debug_backtrace()` calls that are
usually not desired when in production mode.

This is a backport of https://github.com/Seldaek/monolog/pull/1690

Signed-off-by: Luís Cobucci <lcobucci@gmail.com>
2022-07-22 13:04:51 +02:00
henning
24e414c993 Added $datetime parameter to addRecord method to optionally log into the past/future 2022-06-09 10:49:31 +02:00
Gene Alyson Fortunado Torcende
8ac56aa42b RotatingFileHandler to maintain the correct maximum number files when using folder by date (#1671) 2022-06-09 10:41:11 +02:00
Jordi Boggiano
a5d65f6ec4 Fix infinite loops when a log handler triggers logging itself 2022-05-10 11:10:07 +02:00
Jordi Boggiano
5d43fd52d3 Allow UdpSocket to reconnect after close() 2022-05-10 10:29:15 +02:00
Lito
c709906d0a [2.X] Allow stacktraces parser on LineFormatter (#1665)
* Allow stacktraces parser on LineFormatter

* Added includeStacktraces parse tests
2022-05-09 22:37:14 +02:00
Jordi Boggiano
bd24765917 ElasticSearch v8 support (#1662)
* ElasticSearch v8 support
* CI updates

Co-authored-by: Thomas Müller <mimmi20@live.de>
2022-05-08 22:23:46 +02:00
Jordi Boggiano
4c7a12b026 Add SymfonyMailerHandler, deprecate SwiftMailerHandler (#1663) 2022-05-07 13:05:55 +02:00
Jordi Boggiano
f2f66cd480 Fix tests 2022-03-18 10:48:03 +01:00
Marko Vušak
0a023ffb23 Calculate exception message according to PHP version (#1644) 2022-03-18 09:47:05 +01:00
Jordi Boggiano
cb3675ee15 Try fixing ci 2022-03-14 13:51:26 +01:00
Jordi Boggiano
c02d86ffb2 Include record message/context/extra data when throwing an exception because the log cannot be opened, fixes #1630 2022-03-14 13:34:54 +01:00
Gemma Lynn
b39a394c05 Store native BSON types as-is in the MongoDB formatter (#1620) 2022-03-13 21:04:53 +01:00
Bei Xiao
f9a8e87563 SlackWebhookHandler: use footer for username & footer_icon for userIcon (#1617)
* Use footer for username & footer_icon for userIcon

* Update test case for SlackWebhookHandler
2022-03-13 20:29:18 +01:00
Thomas Calvet
8c58abad9e Add AsMonologProcessor attribute (#1637) 2022-03-06 13:08:33 +01:00
Jordi Boggiano
a4e10e8e9e Merge pull request #1587 from nicolas-grekas/psr-log2
Allow psr/log 2.0
2021-09-14 15:21:42 +02:00
Jordi Boggiano
70fe092867 Simplify memoryIniValueToBytes, tweak code to use less memory overall 2021-09-14 15:01:06 +02:00
jcm
0b22036ab6 Add method in Utils to convert memory values from php_ini into bytes, and use lower amount of chunk size based on memory limit 2021-09-14 14:57:16 +02:00
Nicolas Grekas
203bb1b6f5 Fix CI to allow psr/log v2 2021-09-13 14:20:06 +02:00
Juan Morales
82ab6a5f4f Fixes php8 non-backward compatible changes (#1568)
* Utils method added to resolve PCRE error messages properly
2021-07-23 09:16:39 +02:00
Fabien Villepinte
63e195046c Fix Utils::getClass() with PHP8 (#1563) 2021-07-14 12:57:59 +02:00
Jordi Boggiano
19542ed8ef Normalize @inheritDoc tags, refs #1557 2021-07-08 15:23:09 +02:00
Jordi Boggiano
4ef5da80ad Fix CS 2021-07-04 14:04:52 +02:00
Jordi Boggiano
01d104aa78 Add Record/Level/LevelName type aliases and improve phpstan type coverage to level 6 2021-07-04 14:04:52 +02:00
Victor Pryazhnikov
812d63b171 Fix of incorrect DynamoDB mock creation
addMethods([]) breaks the methods configured at onlyMethods() call
2021-04-18 21:33:01 +03:00
Victor Pryazhnikov
c7a5ecca6c Fix of DynamoDbClient::formatAttributes
Looks like formatAttributes() was removed before v3,
so switching to method existence check instead of version check
2021-04-04 21:34:05 +03:00
Victor Pryazhnikov
2bc1351c1e Fix of SyslogUdpHandler mock creation
'datetime' value inside of getRecordWithMessage() result is enough,
getDateTime() method is missing & not being used
2021-02-27 15:55:32 +03:00
Victor Pryazhnikov
240a159d44 Fix of PhpAmqpLib\Channel\AMQPChannel mock creation
__destruct was removed in v2.5.0, but version check is impossible
(\PhpAmqpLib\Package::VERSION was introduced in v2.11.1)
2021-02-27 15:36:32 +03:00
Victor Pryazhnikov
67294a3a5f Fix of Predis\Client mock creation
Predis\Client uses __call method to process commands (rPush, lTrim),
getPartialMock() doesn't work with addMethods()
2021-02-27 15:18:06 +03:00
Victor Pryazhnikov
227343f20b Fix of absent formatAttributes method issue 2021-02-27 15:02:13 +03:00
Victor Pryazhnikov
cdba0c5693 Deprecated setMethods() usages moving to onlyMethods() 2021-02-27 14:47:59 +03:00