tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 55052] New: [JULI] Make ClassLoaderLogManager.getProperty() to try unprefixed property if prefixed one does not exist
Date Mon, 03 Jun 2013 13:08:20 GMT

            Bug ID: 55052
           Summary: [JULI] Make ClassLoaderLogManager.getProperty() to try
                    unprefixed property if prefixed one does not exist
           Product: Tomcat 7
           Version: 7.0.40
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina

The following issue was reported by "Edson" via comments system at

I would like to have a section explaining how to use SimpleFormatter.format,
because I can't make log behave as expected when using JULI. Seems that Tomcat
always ignore my attemps - unless I set in the system property:
%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n" Would this be clarified in

I am confirming this behaviour with with the current Tomcat 7.0.x (7.0.40) and
JDK 7u21.

If add the following line to logging output does not change,
as reported in the comment:

%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n

But, if I add the following line, the output changes for all handlers. (At
least for the console one, catalina.DATE.log and localhost.DATE.log files.
Other log files are empty by default).

%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n

Oracle's SimpleFormatter.format is a static field, an thus is initialized only
once.  While it is good that prefixed "1catalina.*" property works, this
specific formatter cannot be configured per-handler. (One is free to implement
their own formatter that does not use a static field there, or file an
enhancement request to Oracle or OpenJDK).

The code in question is ClassLoaderLogManager.getProperty(String) which does

        if (prefix != null) {
            name = prefix + name;

Thus is a prefix is active it tries only prefixed value of a property and never
tries an unprefixed one.


With SimpleFormatter it would be more sense to configure it using an unprefixed
property, regardless of which Handler is initialized first.

Change the values of "handlers", ".handlers" properties so that an unprefixed
handler is listed first.

In the default configuration that will be ConsoleHandler:

handlers = java.util.logging.ConsoleHandler,,,,

.handlers = java.util.logging.ConsoleHandler,

Alternatively, you can remove a prefix from one of other handlers.

If you do so, and if that handler uses a SimpleFormatter, then the unprefixed
configuration property will work:
%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message