logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45128] New: The conversion pattern M (method name) does not apply when using AsyncAppender
Date Wed, 04 Jun 2008 11:30:38 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45128

           Summary: The conversion pattern M (method name) does not apply
                    when using AsyncAppender
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: ASSIGNED
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: haim.sulam@gmail.com


The conversion pattern M (method name) does not apply when using AsyncAppender.
Instead of writing the method name it writes a question mark.

The class test:
------------Start of class-----------------
package test;

import org.apache.log4j.*;


public class Log4JTest
{
   private static Logger sLogger = Logger.getLogger(Log4JTest.class);
   public Log4JTest()
   {
   }

   public void setString(String str) {
      sLogger.debug(str);
      System.out.println("s=" + str);
   }

   public static void main(String[] args) {
      Log4JTest log4JTest = new Log4JTest();
      String x = "Hello World";
      log4JTest.setString(x);

   }
}
------------End of class-----------------

The log4j configuration:
------------Start of configuration-----------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "../conf/log4j.dtd">
<log4j:configuration debug="false"
xmlns:log4j='http://jakarta.apache.org/log4j/'>

        <!-- ************** -->
        <!-- * Appenders: * -->
        <!-- ************** -->
        <!-- Default -->
        <appender name="Console" class="org.apache.log4j.ConsoleAppender">
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d{ISO8601}
[%-5p] [%t] [%c{3}] [%x]: %m%n"/>
                </layout>
        </appender>

        <appender name="LogFile" class="org.apache.log4j.RollingFileAppender">
                <param name="File" value="../logs/default.log"/>
                <param name="MaxFileSize" value="1024KB"/>
                <param name="MaxBackupIndex" value="10"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d{ISO8601}
[%-5p] [%t] [%c] [%x] [%M]: %m%n"/>
                </layout>
        </appender>

        <appender name="AsyncConsole" class="org.apache.log4j.AsyncAppender">
                 <appender-ref ref="Console"/>
        </appender>

        <appender name="AsyncLogFile" class="org.apache.log4j.AsyncAppender">
                <appender-ref ref="LogFile"/>
        </appender>


        <!-- Tests -->
        <appender name="ViasTestsLogFile"
class="org.apache.log4j.RollingFileAppender">
                <param name="File" value="../logs/tests.log"/>
                <param name="MaxFileSize" value="1024KB"/>
                <param name="MaxBackupIndex" value="10"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d{ISO8601}
[%-5p] [%t] [%c] [%x] [%M]: %m%n"/>
                </layout>
        </appender>

        <!-- Tests -->
        <appender name="AsyncViasTestsLogFile"
class="org.apache.log4j.AsyncAppender">
                <appender-ref ref="ViasTestsLogFile"/>
        </appender>

        <!-- *************** -->
        <!-- * Categories: * -->
        <!-- *************** -->

        <!-- Tests -->
        <category name="test" additivity="false">
                <priority value="debug"/>
                <appender-ref ref="AsyncViasTestsLogFile"/>
        </category>

        <!-- Default -->
        <root>
                <priority value ="debug"/>
                <appender-ref ref="AsyncLogFile"/>
        </root>
</log4j:configuration>
------------End of configuration-----------------


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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message