[slf4j-dev] [Bug 134] New: Allow to set FQCN in Log4jLoggerAdapter class

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Thu May 28 23:17:03 CEST 2009


http://bugzilla.slf4j.org/show_bug.cgi?id=134

           Summary: Allow to set FQCN in Log4jLoggerAdapter class
           Product: SLF4J
           Version: 1.5.x
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Implementations
        AssignedTo: dev at slf4j.org
        ReportedBy: Bieringer.Dominik at gmx.at


I have the following scenario: Instead of using the Logger interface from SLF4J
directly in the classes that do the logging, I wrote my own interface that is
used. Because of that I have a class called LogAdapter which implements my
interface and internally delegates logging calls to SLF4J.

I use the slf4j-log4j12 jar file and have configured log4j to include the
calling class name in the log output. After I changed my code to not use the
SLF4J logger directly, but instead send log messages to the LogAdapter, which
then sends the log messages to SLF4J, the class names written to the log files
are not correct any more.

I downloaded source files of SLF4J and log4j and found out that there is a
field called FQCN in the Log4JLoggerAdapter class which is passed to log4j on
logging calls. The FQCN is used by Log4J to determine the name of the class
that caused a logging statement. The problem is that this field is final and
hence I am not able to modify it even via reflection when using the
setAccessible(true) method.

Is there any way to make this class configurable from the outside? Maybe
provide  setter? If this is not feasible, removing the final modifier would at
least allow to modify it via reflection...


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the slf4j-dev mailing list