java.util.logging misbehavior when called from JRuby ----------------------------------------------------
Key: JRUBY-3628 URL: http://jira.codehaus.org/browse/JRUBY-3628 Project: JRuby Issue Type: Bug Components: Core Classes/Modules, Java Integration Affects Versions: JRuby 1.2 Environment: Java 1.6, JRuby 1.2 Reporter: Morten Christensen When calling Java's java.util.logging system within Jruby, the logger name is wrongly set to "sun.reflect.NativeMethodAccessorImpl" instead of the logger name specified by the call to Logger. Apart from making things difficult when reading the log, this also cause the normal java log filters to malfunction (i.e the log messages from jruby may not appear unless a special/default log level is set to log sun.reflect also). This is a major problem with java/jruby projects, as proper logging behavior is essential for production systems! To reproduce try this under IRB: log = java.util.logging.Logger.getLogger('com.test.xxx') log.addHandler(java.util.logging.ConsoleHandler.new()) log.log(java.util.logging.Level::SEVERE, 'Logging from JRuby') The correct result would be something like: May 7, 2009 1:31:13 PM com.test.xx ??? SEVERE: Logging from JRuby But JRuby 1.2 incorrectly writes: May 7, 2009 1:31:13 PM sun.reflect.NativeMethodAccessorImpl invoke0 SEVERE: Logging from JRuby -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email