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 47588] New: Effective Level of logger randomly changes
Date Mon, 27 Jul 2009 14:44:25 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47588

           Summary: Effective Level of logger randomly changes
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: slfrank@fedins.com


Under heavy load scenarios (20 users, 1 hit per second each), the effective
logging level will randomly change to erroneous values (Set at Info, changes to
debug or fatal, etc). This prevents some messages from printing, and others
printed when they should not be.

Code.
        if (logger.isDebugEnabled()) {
            System.out.println("Start");
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Logger level: " + logger.getEffectiveLevel());
            System.out.println("Done");
        }

Output:

[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Start
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: DEBUG
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: WARN
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:404 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Logger level: FATAL
[7/23/09 12:09:12:419 CDT] 0000002a SystemOut     O Done


System.out.println is only used in this case to ensure it is always printed so
it can debug. Normally would use log4j.debug/etc.

rootlogger and class level loggers are all set up for ERROR in this case.

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

---------------------------------------------------------------------
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