enqueue-dev icon indicating copy to clipboard operation
enqueue-dev copied to clipboard

Improve log extension to avoid unique messages

Open SpartakusMd opened this issue 5 months ago • 7 comments

Currently the log extension is adding the processed message body to the log message. This creates unique logs, and duplicates the info as it's added in the log context. It's not an issue per se, but if you use Sentry (or similar tools), you receive issues for each message handled with error.

What do you think about excluding it?

SpartakusMd avatar Jul 16 '25 13:07 SpartakusMd

Sending debug level logs to Sentry is, in general, a bad idea. Even with a on-premise setup it will simply generate a ton of useless logs (unless you make more complex decision making about what is sent and what isn't based on maybe channel settings).

That said, I agree that if it's in context, it could be removed from the main message string.

Steveb-p avatar Jul 16 '25 14:07 Steveb-p

The thing is that it's an error level log if the processing of the message was not successful. And you cannot easily filter messages that are sent to Sentry. Please see https://github.com/php-enqueue/enqueue-dev/pull/1394/files#diff-61f6a09a5a7e5b04b1179fa9524988b42ac12eace842080d2397c699af81a373L63

SpartakusMd avatar Jul 16 '25 15:07 SpartakusMd

Right, I see now :) Yeah, definitely looks good to me, just need tests adjusted to the new variant.

Steveb-p avatar Jul 16 '25 17:07 Steveb-p

Sure, thing. Should be fine now.

SpartakusMd avatar Jul 17 '25 04:07 SpartakusMd

Does it look good? Is there anything else I could help to get it merged and released?

SpartakusMd avatar Jul 23 '25 06:07 SpartakusMd

@Steveb-p any way to help this move forward?

SpartakusMd avatar Sep 19 '25 06:09 SpartakusMd

@makasim could you review this when you have some time?

SpartakusMd avatar Sep 19 '25 06:09 SpartakusMd