Bug 3228 - code logging to frysk.proc doesn't show up
Summary: code logging to frysk.proc doesn't show up
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Unassigned
Depends on:
Blocks: 1839 2234
  Show dependency treegraph
Reported: 2006-09-18 18:41 UTC by Andrew Cagney
Modified: 2007-02-16 11:39 UTC (History)
1 user (show)

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2006-09-18 18:41:24 UTC
Code doing:

  logger = getLogger ("frysk.proc");

rather than:

  logger = getLogger ("frysk");

doesn't get its output sent to the logger (but sometimes it does :-/)
Comment 1 Andrew Cagney 2006-09-18 19:13:09 UTC
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.
Comment 2 Andrew Cagney 2006-09-18 22:05:27 UTC
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.
Comment 3 Mark Wielaard 2006-09-19 09:47:38 UTC
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());
Comment 4 Mark Wielaard 2006-09-19 09:48:43 UTC
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.
Comment 5 Mark Wielaard 2006-09-19 10:05:44 UTC
Upstream bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29137
Comment 6 Mark Wielaard 2006-09-19 11:13:33 UTC
Fixed upstream. Needs to be pushed to libgcj and rawhide.
Comment 7 Andrew Cagney 2006-09-19 14:13:27 UTC
Downstream RHEL 5 bug.
Comment 8 Andrew Cagney 2006-09-19 14:24:40 UTC
Current workaround is to use a flat log name space; everything is in "frysk".
Comment 9 Andrew Cagney 2006-09-19 15:01:26 UTC
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.
Comment 10 Kris Van Hees 2007-02-12 14:32:23 UTC
> 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.
Comment 11 Mark Wielaard 2007-02-12 16:32:30 UTC
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
Comment 12 Mark Wielaard 2007-02-16 11:39:45 UTC
Installed patch from comment #11.

       * Makefile.am (frysk3228/LoggerParent): Add to TESTS.