Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
20.96k stars 1.9k forks source link

Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object. #1834

Closed koekaverna closed 10 months ago

koekaverna commented 1 year ago

Monolog version 2|3

When NormalizeFormatter use method_exists on incomplete object it cause fatal error.

I found the problem in logs without any stacktrace information. It can happen when unserialize wrong response from service or unserialize outdated data from session. Anyway NormalizeFormatter should not make fatal error even on corrupted data.

I made PR with fix. Please check it out. https://github.com/Seldaek/monolog/pull/1833

koekaverna commented 10 months ago

@Seldaek Hi, it's not fixed in 2.9.2 JsonFormatter. There is normalize method override NormalizerFormatter::normalize and have same problem...

Seldaek commented 5 months ago

@koekaverna https://github.com/Seldaek/monolog/commit/884aa47a055ea3e8e351ceaf4dfc67f52fff44c0 should take care of this for JsonFormatter at last.