Solved my own problem. Helps when you get access to decent document in the
form of Ceci's book :) Would like to make a friendly suggestion for the
basic documentation to be extended. But regardless for those out there who
don't plan to buy the book.

There are 3 params you can enter for the ASYNC appender:
*    BufferSize - which defaults to 128 messages
*    LocationInfo - boolean deafults to false
*    Threshold - no idea what this does

So insert the LocatioInfo param tag i.e.

<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
  <param name="BufferSize" value="256"/>
  <param name="LocationInfo" value="true"/>
  <appender-ref ref="TEMP"/>
  <appender-ref ref="CONSOLE"/>
 </appender>

I added the BufferSize for fun. Pretty easy when you find the documentation.
Refer to the javadoc on the AsyncAppender which shows the methods for the
setLocationInfo and setBufferSize:
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/AsyncAppender.html

Terence

----- Original Message -----
From: "Terence Ingram" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 10:33 AM
Subject: ASYNC Appender not printing line or class information


> I have searched the archives for a resolution to this problem and the only
> reference is:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg06540.html
> which does not appear to have a resolution.
>
> My problem. I have upgraded to log4j 1.2.8 I am using the Async appender
and
> then sending all messages to STDOUT and a file. Below is an example of my
> log4j.xml file. The interesting point is that the information for switches
> %L, %F, %M all produce the deadly or rather infamous "?"".
>
> I have read the documentation stating that potentially I need to ensure
that
> my compiled code does not use the -O option. Fine. It doesn't. I tried
> another test by not using the ASYNC Appender i.e. just pumping the output
to
> the CONSOLE. The information for the offending switches is then returned.
>
> This has the same behaviour on windows and linux.
>
> My question is: What's the deal the this ASYNC appender. How can this be
> remedied?
>
> Terence
>
> <?xml version="1.0" encoding="UTF-8"?>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
> debug="true">
>  <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>   <appender-ref ref="TEMP"/>
>   <appender-ref ref="CONSOLE"/>
>  </appender>
>  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
>   <layout class="org.apache.log4j.PatternLayout">
>    <param name="ConversionPattern" value="%d{ISO8601} %5p [%t] %-2c
> (%F:%L) - %m%n"/>
>   </layout>
>  </appender>
>  <appender name="TEMP" class="org.apache.log4j.FileAppender">
>   <param name="File" value="c:\\temp\\mylogfile.log"/>
>   <layout class="org.apache.log4j.PatternLayout">
>    <param name="ConversionPattern" value="%d{ISO8601} %r %-5p [%t] %x
> %-2c#%M (%F:%L) - %m\n"/>
>   </layout>
>  </appender>
>  <root>
>   <priority value="debug"/>
>   <appender-ref ref="ASYNC"/>
>  </root>
> </log4j:configuration>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to