Code doing: logger = getLogger ("frysk.proc"); rather than: logger = getLogger ("frysk"); doesn't get its output sent to the logger (but sometimes it does :-/)
Given the sequence: -> create <<frysk.proc>> logger -> set <frysk>> logging level to FINE -> create <<frysk.rt>> logger the former logger doesn't pick up the logging change, but the latter does.
From: http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Logger.html The log level can be configured based on the properties from the logging configuration file, as described in the description of the LogManager class. However it may also be dynamically changed by calls on the Logger.setLevel method. If a logger's level is changed the change may also affect child loggers, since any child logger that has null as its level will inherit its effective level from its parent.
This seems to be a bug in classpath/libgcj. In the following code both ab and ac should have the same parent a, but they don't: import java.util.logging.*; public class t { public static void main(String[] args) throws Exception { Logger ab = Logger.getLogger("a.b"); Logger a = Logger.getLogger("a"); Logger ac = Logger.getLogger("a.c"); System.out.println("a: " + a); System.out.println("ab parent: " + ab.getParent()); System.out.println("ac parent: " + ac.getParent()); } }
Workaround for now seems to be to create the "frysk" logger as early as possible so it is correctly set as parent of all child loggers.
Upstream bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29137
Fixed upstream. Needs to be pushed to libgcj and rawhide.
Downstream RHEL 5 bug. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207111
Current workaround is to use a flat log name space; everything is in "frysk".
Test case added to frysk and workaround has been applied; closing local tracker. Index: frysk-imports/tests/ChangeLog 2006-09-19 Andrew Cagney <cagney@redhat.com> * Makefile.am (XFAIL_TESTS): Add frysk3228/LoggerParent. * frysk3228/LoggerParent.java: New test. From Mark Wielaard. Once the gcj/classpath stuff has been pushed the test can be flipped to PASS so that the build requires a working CLASSPATH logger.
> Once the gcj/classpath stuff has been pushed the test can be flipped to PASS so > that the build requires a working CLASSPATH logger. Not sure what the status is on systems other than FC6, but my FC6 (updated to the latest patch level) has this test pass perfectly. Unless there is a problem with distributions that don't have the correct versions of the java.util.logging classes, I'd suggest we flip this to be PASS at this point.
diff -u -r1.95 Makefile.am --- frysk-imports/tests/Makefile.am 9 Feb 2007 16:27:30 -0000 1.95 +++ frysk-imports/tests/Makefile.am 12 Feb 2007 16:31:57 -0000 @@ -448,7 +448,9 @@ audit_test_audit_libs_LDADD = -laudit noinst_PROGRAMS += audit/test-audit-libs -XFAIL_TESTS += frysk3228/LoggerParent +# Failed with gcj 4.1 and earlier versions of 4.2 +#XFAIL_TESTS += frysk3228/LoggerParent +TESTS += frysk3228/LoggerParent frysk3228_LoggerParent_SOURCES = frysk3228/LoggerParent.java frysk3228_LoggerParent_LDFLAGS = --main=LoggerParent noinst_PROGRAMS += frysk3228/LoggerParent
Installed patch from comment #11. * Makefile.am (frysk3228/LoggerParent): Add to TESTS.