Bug 31 - Conversion of log4j Priority types to NT EventLog types not working
Summary: Conversion of log4j Priority types to NT EventLog types not working
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.0
Hardware: PC All
: P1 minor
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2001-01-11 16:56 UTC by Jennifer
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Jennifer 2001-01-11 16:56:06 UTC
Overview Description:
All log4j priority types are logged as "Information" type in the NT EventLog 
regardless of the priority assigned when calling log4j logging methods.

Steps to Reproduce: 
1) Execute the example code "NTMin.java" located in the 
org\apache\log4j\nt\test package.  (Provided with 1.0 version of log4j).

Actual Results: 
Log messages are successfully written to the NT EventLog but they all have the 
same priority ("Information").

Expected Results:
Of the six messages that are logged by the example code, 3 should appear 
as "Information" type, 2 should appear as "Error" type, and 1 should appear 
as "Warning" type.

Build Date & Platform:
Windows 2000, Version 5.0, Build 2195
Comment 1 BugZilla Maintainer Account 2001-01-11 17:29:02 UTC
Hello Jennifer,

The problem is due to the wrong direction of comparisons in the appende 
method of NTEventLogAppender.

The correct comparison is:

    // Anything above FATAL or below DEBUG is labeled as INFO.
    if (nt_category > FATAL || nt_category < DEBUG) {
      nt_category = INFO;

I have changed this for the next release. Ceki