directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <>
Subject Re: Operation timing in logs
Date Thu, 16 May 2013 16:55:18 GMT
Le 5/16/13 6:36 PM, Alex Karasulu a écrit :
> Hmm this is neat and could be pretty damn useful.
> What about making this happen using a request control? Meaning if an
> operation is issued with the TRACE request control then turn on the
> production and output to the logs of such trace information? The control is
> a simple marker control. This would reduce the amount of noise and logging
> overhead if your'e interested in specific operations.
> What would be uber bad-assery would be to collect this information and
> report it not only in the logs but to return it in a buffer with a response
> control. This makes sense to inspect production system issues that are
> misbehaving without a shutdown.
> Another idea in leu or in addition would be to enable some parameters in
> the configuration that could hot enable/disable this feature.
> In both cases, you would not have to shutdown the server and would still
> have fine grained control over the quantity of logs produced with trace
> information.

The idea of beng able to tune those parameters alive are tempting,
sadly, due to the way the logger is activated (ie, as we are using
static variable to control the traces), we will have to restart the
server anyway :

    private static final Logger OPERATION_TIME =
LoggerFactory.getLogger( Loggers.OPERATION_TIME.getName() );
    private static final boolean IS_TIME = OPERATION_TIME.isDebugEnabled();
        if ( IS_TIME )
            addStart = System.nanoTime();

Here, if the logger is disabled, the log will simply be discarded from
the class at load time :/

OTOH, we could get rid of those checks (if IS_TIME) and we then can
think about activating or disable the trace live. The price to pay is
quite expensive though : around 3% overall penalty.

This is a price we would like to pay though.

Last, not least : I'd rather modify the config and have the server react
to such a modification rather than defining a Control that nobody will
now about...

Emmanuel Lécharny 

View raw message