Seldaek / monolog

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

Extending Processors - private properties #1888

Closed acdc76 closed 2 months ago

acdc76 commented 4 months ago

Monolog version 2

Are the library classes ment to be extended? If so, please make all methods and properties protected instead of private.

I tried to extend IntrospectionProcessor to add a whole callstack, but IntrospectionProcessor has private $level; and others, so it's not possible to extend easily.

Seldaek commented 2 months ago

I'd say rather send a PR to have a new option on it so everyone interested can benefit, instead of extending.. Otherwise if you don't want to contribute it then just copy the code, it's a very small class and I'd rather keep it more easily maintainable without having to consider extension points.

If you only need Level btw you could override the constructor and store the level on your class as well, then pass it along to parent constructor.