[GH-ISSUE #436] choose backtrace level in IntrospectionProcessor #148

Closed
opened 2026-03-04 02:12:38 +03:00 by kerem · 4 comments
Owner

Originally created by @pactole on GitHub (Oct 14, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/436

Hi Jordi,

We've override Monolog in our project

  • to add a KibanaFormatter.
  • To make it work with our old Logger

This override makes the IntrospectionProcessor not working because our current back_trace level is 3 instead of 2 in your code.

I've been forced to fork your IntrospectionProcessor Class because the properties you declare are private ($level, $skipClassesPartials).
The Idea is to set a backtrace_level property to execute array_shift($trace) n times

I may be wrong in the use of the proscessors to get the proper line, file, class and function.

In the case I'm not wrong... could the properties declared in IntrospectionProcessor be protected?
Do you need a pull request for that?

Best regards, and keep on the good work!

Jacques

Originally created by @pactole on GitHub (Oct 14, 2014). Original GitHub issue: https://github.com/Seldaek/monolog/issues/436 Hi Jordi, We've override Monolog in our project - to add a KibanaFormatter. - To make it work with our old Logger This override makes the IntrospectionProcessor not working because our current back_trace level is 3 instead of 2 in your code. I've been forced to fork your IntrospectionProcessor Class because the properties you declare are private ($level, $skipClassesPartials). The Idea is to set a backtrace_level property to execute array_shift($trace) n times I may be wrong in the use of the proscessors to get the proper line, file, class and function. In the case I'm not wrong... could the properties declared in IntrospectionProcessor be protected? Do you need a pull request for that? Best regards, and keep on the good work! Jacques
kerem closed this issue 2026-03-04 02:12:39 +03:00
Author
Owner

@Seldaek commented on GitHub (Oct 15, 2014):

You can probably just fix it by tweaking the $skipClassesPartials argument when you construct it. For example if your class extending Monolog\Logger is called Foo\Bar just pass in array('Foo\\Bar','Monolog\\') so it ignores your class from the backtrace as well.

<!-- gh-comment-id:59204561 --> @Seldaek commented on GitHub (Oct 15, 2014): You can probably just fix it by tweaking the $skipClassesPartials argument when you construct it. For example if your class extending `Monolog\Logger` is called `Foo\Bar` just pass in `array('Foo\\Bar','Monolog\\')` so it ignores your class from the backtrace as well.
Author
Owner

@pactole commented on GitHub (Oct 15, 2014):

Thanks for the reply!

I'll try that and leave a comment.

Have a nice day

Jacques

<!-- gh-comment-id:59206722 --> @pactole commented on GitHub (Oct 15, 2014): Thanks for the reply! I'll try that and leave a comment. Have a nice day Jacques
Author
Owner

@pactole commented on GitHub (Oct 17, 2014):

I had to make a lot of refactorisation as the original implementation didn't fit Monolog standards.
And It works :).

<!-- gh-comment-id:59486567 --> @pactole commented on GitHub (Oct 17, 2014): I had to make a lot of refactorisation as the original implementation didn't fit Monolog standards. And It works :).
Author
Owner

@Seldaek commented on GitHub (Oct 17, 2014):

OK cool, closing this then.

<!-- gh-comment-id:59486922 --> @Seldaek commented on GitHub (Oct 17, 2014): OK cool, closing this then.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#148
No description provided.