1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00
Commit Graph

1646 Commits

Author SHA1 Message Date
Jordi Boggiano
2ae044482c Fix serializability of Logger class, fixes #1792 2023-02-06 14:33:41 +01:00
Tetragramat
1f25f9b343 WhatFailureGroupHandler catches failures in method close (#1791) 2023-02-04 22:53:22 +01:00
Bart Swaalf
8255feb444 Add support for enum context values to psr formatter (#1773) 2023-02-04 16:05:18 +01:00
Jordi Boggiano
6459aeb4a7 Fix ignores 2023-02-04 15:53:31 +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
Mikhail Popov
58f503004d Fix setting of extra attributes in AmqpHandler when handling batches of records (#1781)
One of content_type, content_encoding, message_id, user_id, app_id, delivery_mode, priority, timestamp, expiration, type or reply_to, headers.

Co-authored-by: Попов Михаил <popov.mv@betcity.ru>
2023-02-04 15:46:32 +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
6bf3b35b80 Deprecate FlowdockHandler and formatter as the service was shutdown, fixes #1748 2022-08-20 14:12:43 +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
pafernandez-oesia
620dca1126 Update BrowserConsoleHandler console output method (#1739)
Instead of using console.log for all log levels, it uses debug, info, warn and error methods depending on the log level.
This makes filtering logs easier in the browser console and highlights error level messages.
2022-08-02 13:47:03 +02: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
9c1fb56f6a Deprecate CubeHandler and PHPConsoleHandler which are targetting abandoned projects, fixes #1734 2022-07-22 15:00:02 +02:00
erikn69
27dc1b2ef7 Fix utf8_encode deprecation (#1722) 2022-07-22 14:23:53 +02:00
Jordi Boggiano
83db4b3f81 Handle depth to avoid cases where an exception has many too many previous exceptions, fixes #1726 2022-07-22 14:18:01 +02:00
Jordi Boggiano
475bc87409 Fix issues 2022-07-22 13:33:21 +02:00
Max Ageev
af8efac0d5 Check if errorMessage contain error "File exists"
Fixes #1678, closes #1685

When we try to create directory we got error and find out that error is to the fact that directory already was created for us.
If that the case we should not throw exception as it's fine now...
If file was deleted after that it's not problem of this funtion.
2022-07-22 13:19:52 +02:00
Jordi Boggiano
11be0a4b30 Fix phpstan errors 2022-07-22 13:15:11 +02:00
Mikhail Popov
3734f190f8 Add the ability to set or redefine attributes for messages in Rabbit. (#1724)
One of content_type, content_encoding, message_id, user_id, app_id, delivery_mode, priority, timestamp, expiration, type or reply_to, headers.

Co-authored-by: Попов Михаил <popov.mv@betcity.ru>
2022-07-22 13:08:34 +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
eac0c22ad2 Mark TestCase internal until PHPStorm handles this better, fixes #1677 2022-06-09 10:40:17 +02:00
Dmitry Menshikov
64854f09da Correct handling of E_USER_ERROR as fatal error if registerErrorHandl… (#1670)
* Correct handling of E_USER_ERROR as fatal error if registerErrorHandler is called with callPrevious, fixes #1669
2022-06-09 09:04:15 +02:00
Jordi Boggiano
9c1566a971 Add a way to disable logging loop detection, closes #1681 2022-06-08 21:51:47 +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
508df120fa Make AsMonologProcessor compatible with PHP 7.2 2022-04-08 17:32:03 +02:00
Jordi Boggiano
77b71e0baf Fix syntax 2022-03-18 10:43:11 +01:00
jszczypk
f0e0dbaa52 added information about call type from debug_backtrace (#1612)
$record['extra']['callType'] will contain current call type: "->" or "::" depending if it was normal or static method call.
Gives possibility to nicely format messages "{$record['extra']['class']}{$record['extra']['callType']}{$record['extra']['function']} ..."
2022-03-18 10:31:44 +01:00
Jordi Boggiano
330b80ceb7 One day I will learn 2022-03-14 13:41:10 +01:00
Jordi Boggiano
f1f2e3e37c Fix fix 2022-03-14 13:39:42 +01:00
Jordi Boggiano
b886d70a35 Fixes 2022-03-14 13:35:56 +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
Jordi Boggiano
e289293a7c PHPStan fixes 2022-03-14 13:03:53 +01:00
Jordi Boggiano
f764bbdc0c Add includeStacktraces constructor parameter to LineFormatter & JsonFormatter, fixes #1603 2022-03-14 12:48:06 +01:00
Jordi Boggiano
93369fd88f Add LogRecord interface for forward compatibility 2022-03-14 12:41:50 +01:00
Yup
1c8f39a94d Allow easier extend of BrowserConsoleHandler.php (#1593)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2022-03-13 21:19:51 +01:00
Gemma Lynn
b39a394c05 Store native BSON types as-is in the MongoDB formatter (#1620) 2022-03-13 21:04:53 +01:00
Yurun
6f233d2e2f Remove unused variable (#1628) 2022-03-13 20:31:19 +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
Anatoly Pashin
baf2d9d4a7 Check whether graylog2/gelf-php is installed in GelfMessageFormatter constructor (#1624) 2022-03-07 14:50:57 +01:00
Eugene Ivanov
832660ec68 Handling the maximum length of a Telegram message (#1616)
* Handling the maximum length of a Telegram message

The maximum allowed length of a Telegram message - 4096 symbols (https://core.telegram.org/bots/api#message, 'text' field). 
Longer messages are not delivered.
Therefore, I implemented splitting too long message into several (with a 1 second delay between sending according to the documentation - https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this) as the default behavior. 
An additional option that you can enable by truncateLongMessage is to leave one message, but truncate it to the maximum length allowed.

* Changed handling of long messages (default - truncation, delay - optional)

* PSR-12 code formatting
2022-03-07 14:37:10 +01:00