Open ppkarwasz opened 1 month ago
@ppkarwasz Thank you for this PR.
For the moment, I fail to see the circumstances under which the LocationAwareLogger.log()
method may be called. Still investigating though.
For the moment, I fail to see the circumstances under which the
LocationAwareLogger.log()
method may be called. Still investigating though.
I am not entirely sure when SubstituteLogger
is used (or if it is used at all these days), but I assume that it could appear in OSGi environments if:
Since LocationAwareLogger
is the oldest available mechanism to transfer caller boundary information, it is commonly used in API-to-API bridges, e.g. the Log4j API-to-SLF4J bridge or Spring JCL-to-SLF4J bridge.
Newer mechanisms such as LoggingEventAware
(for logger implementations) or CallerBoundaryAware
(for logger builder implementations) are less common. The default LoggingEventBuilder
also requires the underlying logger to either implement LocationAwareLogger
or LoggingEventAware
:
Currently,
SubstituteLogger
neither supports location information from upstream callers nor passes location information to the delegated logger.This PR:
LocationAwareLogger
, which allows upstream callers to pass location information both through theLocationAwareLogger
API and the fluent API.This is related to #425.