uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marshall Schor (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-2374) Log4jLogger_impl always logs wrapper class name instead of caller class name
Date Wed, 02 May 2012 19:04:50 GMT

    [ https://issues.apache.org/jira/browse/UIMA-2374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266820#comment-13266820
] 

Marshall Schor commented on UIMA-2374:
--------------------------------------

The first part of the patch changes a logging call in an attempt to include the class of the
caller.  But it seems it would include the class of the wrapper class.  Am I missing something?
 Here is what the patch says:
{code}
-         org.apache.log4j.Logger.getLogger(sourceInfo[0]).info(aMessage);
+         org.apache.log4j.Logger.getLogger(sourceInfo[0]).log(getClass().getName(), 
+                 org.apache.log4j.Level.INFO, aMessage, null);
{code}

The 1st argument to the .log call is supposed to be the fully qualified name of the class.
 But this would get the fully qualified name of "this" class, which is org.apache.uima.util.impl.Log4jLogger_impl,
I think.
                
> Log4jLogger_impl always logs wrapper class name instead of caller class name
> ----------------------------------------------------------------------------
>
>                 Key: UIMA-2374
>                 URL: https://issues.apache.org/jira/browse/UIMA-2374
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 2.4.0SDK
>            Reporter: Richard Eckart de Castilho
>            Priority: Minor
>              Labels: patch
>             Fix For: 2.4.1SDK
>
>         Attachments: UIMA-2374-REC-2012-02-20.patch
>
>
> When enabling classname/filename logging in Log4J, Log4jLogger_impl currently will allways
log the  Log4jLogger_impl class/file instead of the name of the caller. This can be fixed
by using the Log4J methods intended for use by logger wrappers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message