I’m surprised that case isn’t working for you. Looking at the code leads me to 
believe it should but I will have to test it myself to see what is going on. 
That could take a few days.

Ralph

> On Jun 22, 2015, at 5:22 AM, David KOCH <[email protected]> wrote:
> 
> Hello,
> 
> Is there any way to programatically determine if a logger is enabled for a
> specific log level and marker? If so how? There is a Logger#isEnabled(Level
> level, Marker marker) method but it seems it ignores the marker argument.
> 
> I would like to avoid carrying out relatively expensive operations required
> for preparing the log message when it's not required. The alternative,
> implementing Message#getFormattedMessage would be quite clumsy in this case
> so I'd like to be able to pre-check based on marker and log level instead.
> 
> I did like this in the log4j.xml:
> 
> <Logger name="com.xxxxx.rtb.log.LoggingBidInterceptor" level="info"
> additivity="false">
>    <MarkerFilter marker="bid_req_proto" onMatch="DENY" onMismatch="DENY"/>
>  <AppenderRef ref="Console"/>
>  <AppenderRef ref="KafkaBidRequest" level="info"/>
>  <AppenderRef ref="KafkaBidResponse" level="off"/>
> </Logger>
> 
> but logger.isInfoEnabled(MarkerManager.getMarker("bid_req_proto"))
> evaluates to to "true" whatever way I set up the MarkerFilter.
> 
> Regards,
> 
> /David



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to