phamthaithinh / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Log level is case-sensitiv #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In web.xml, I configure the log level with
 <init-param>
            <param-name>logLevel</param-name>
            <param-value>sysout:DEBUG</param-value>
 </init-param>
2. I start my application server

What is the expected output? What do you see instead?
I expect the logs in my application server but can't see any output.
When i use SYSOUT:DEBUG instead, it works.

What version of the product are you using? On what operating system?
Windows 7, UrlRewriteFilter 3.2.0 build 1 configuration overview (generated 
5/9/11 2:38 PM)

Please provide any additional information below.

This is the code with errors, I guess:
org.tuckey.web.filters.urlrewrite.utils.Log#setLevel(String level)

    public static void setLevel(String level) {

        usingSystemOut = false;
        usingSystemErr = false;
        // check for log type on the front
        if ("LOG4J".equalsIgnoreCase(level)) {
            usingLog4j = true;
        } else if ("SLF4J".equalsIgnoreCase(level)) {
            usingSlf4j = true;
        } else if ("COMMONS".equalsIgnoreCase(level)) {
            usingCommonsLogging = true;
        } else {
            // log need to parse level also
            if (level != null) {
                if (level.startsWith("SYSOUT:")) {
                    usingSystemOut = true;
                    level = level.substring("SYSOUT:".length());
                }
                if (level.startsWith("STDOUT:")) {
                    usingSystemOut = true;
                    level = level.substring("STDOUT:".length());
                }
                if (level.startsWith("STDERR:")) {
                    usingSystemErr = true;
                    level = level.substring("STDERR:".length());
                }
                if (level.startsWith("SYSERR:")) {
                    usingSystemErr = true;
                    level = level.substring("SYSERR:".length());
                }
            }
            setLevelInternal(level);
        }
    }

Original issue reported on code.google.com by tschoe...@gmail.com on 9 May 2011 at 12:41

GoogleCodeExporter commented 9 years ago
Thanks.  I've fixed this.  Change is here:
https://code.google.com/p/urlrewritefilter/source/detail?r=315

Original comment by tuc...@gmail.com on 24 Oct 2011 at 9:58