zendframework / zend-log

Log component from Zend Framework
BSD 3-Clause "New" or "Revised" License
62 stars 51 forks source link

Allow custom ignored namespaces in backtrace processor #83

Closed adam-ja closed 5 years ago

adam-ja commented 6 years ago

The backtrace processor adds the file, line, class, and function responsible for triggering a log to the event extras.

By default, classes in the backtrace under the Zend\Log namespace are ignored so that we can see the actual application code that called the log().

However, there might also be cases when we want to ignore other namespaces so that we get the true origin. The example I came across that prompted this patch was Psr\Log, which appears when the PsrLoggerAdapter wraps the underlying Zend Logger.

This patch allows us to add our own custom ignored namespaces in addition to the default Zend\Log.

weierophinney commented 6 years ago

This looks like a great feature!

Can you please also add documentation (under the doc/book/ tree) detailing the new methods and options?

Thanks!

adam-ja commented 6 years ago

Docs added - sorry for the delay.

There's really nothing to say about getIgnoredNamespaces() as there's probably not a great deal of use for it beyond testing/debugging.

michalbundyra commented 5 years ago

Thanks, @adam-ja!