logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40784] New: - Level per user
Date Wed, 18 Oct 2006 10:11:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40784

           Summary: Level per user
           Product: Log4j
           Version: 1.2
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: stefano.nichele@gmail.com


In Log4j 1.2, there is not a way to specified a level for a specified user.

Use case:
I have a web application and I want to keep the log level to info or error and
just set to debug for a single user. 
I know with MDC i'm able to track the username and i know there is a MDCFilter
in order to filter the log that matches the filter.
What I can do is to set to ALL the global level and then in the filter, to log
only the record of the user/s I want.
I think there is a big drawback in this approach. Basically my log calls are
done checking first of all if the level is enable (code guard):

if (log.isDebugEnable()) { 
    log.debug(....);
}

in order to avoid the parameter evaluation if debug is disabled. 
Using MDCFilter all calls will be evaluated with a potentially big impact on the
performance because the filters are evaluated when the log message is sent to
the appenders.

My idea is to add to each logger a level selector. Like for the appenders, log4j
could provide some implementations as LoggerLevelSelector (this should return
the level of the logger (maybe not needed)) or UserLevelSelector or
MDCLevelSelector.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message