You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/08/18 01:00:23 UTC

[Bug 60012] New: Several log refactoring/improvement suggestions

https://bz.apache.org/bugzilla/show_bug.cgi?id=60012

            Bug ID: 60012
           Summary: Several log refactoring/improvement suggestions
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: chenfsd@gmail.com

Method Invocation Replaced By Variable:

in file:
apache-tomcat-8.5.4-src/java/org/apache/catalina/authenticator/AuthenticatorBase.java
line 441 - 448
principal = session.getPrincipal();
if (principal != null) {
    if (log.isDebugEnabled()) {
        log.debug("We have cached auth type " + session.getAuthType() +
                " for principal " + session.getPrincipal());
    }
    request.setAuthType(session.getAuthType());
    request.setUserPrincipal(principal);
}

"session.getPrincipal()" could be replaced by variable "principal"

in file: apache-tomcat-8.5.4-src/java/org/apache/catalina/realm/JNDIRealm.java
line 2693- 2696

String absoluteName = result.getName();
if (containerLog.isTraceEnabled())
   containerLog.trace("  search returned absolute name: " +
           result.getName());

"result.getName()" can be replaced with "absoluteName"

*Printing null in logs*
apache-tomcat-8.5.4-src/java/org/apache/catalina/storeconfig/StoreLoader.java

line 252 - 254
if ((is == null) || (error != null)) {
    log.error(error);
}

apache-tomcat-8.5.4-src/java/org/apache/catalina/startup/CatalinaProperties.java
line 110 -115
if ((is == null) || (error != null)) {
    // Do something
    log.warn("Failed to load catalina.properties", error);
    // That's fine - we have reasonable defaults.
    properties = new Properties();
}

in the above two scenario, there is a change "error == null", there should be a
null check inside the logs.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 60012] Several log refactoring/improvement suggestions

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60012

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 60012] Several log refactoring/improvement suggestions

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60012

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Thanks for the report.
This has been fixed in
- 9.0.x for 9.0.0.M10 onwards and
- 8.5.x for 8.5.5 onwards

Regards,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

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