logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moshe Matitya" <Moshe.Mati...@Kayote.com>
Subject RE: AsyncAppender not working
Date Wed, 27 Jun 2007 10:04:43 GMT
Hi, George.

Thank you for responding.  I appreciate your taking the time.

I tried your config file, after commenting out the references to the
DDSAppender (so that it configures just one AsyncAppender, to which the
ConsoleAppender is attached).  Unfortunately, it did not work:  It, too,
produced the same error message ("No appender named [CONSOLE] could be
found"), and nothing was logged to the console.

The following was the debug output:

    log4cxx: The "configDebug" attribute is deprecated.
    log4cxx: Use the "internalDebug" attribute instead.
    log4cxx: Threshold ="".
    log4cxx: Level value for root is [debug].
    log4cxx: OptionConverter::toLevel: no class name specified,
level=[debug]
    log4cxx: root level set to DEBUG
    log4cxx: Class name: [org.apache.log4cxx.AsyncAppender]
    log4cxx: Attaching appender named [CONSOLE] to appender named
[ASYNC_CONSOLE].
    log4cxx: No appender named [CONSOLE] could be found.
    log4cxx: Adding appender named [ASYNC_CONSOLE] to logger [root].

A couple of questions:

(1) Are you by any chance using the old, deprecated version of log4cxx
(0.9.7)?  I only began experiencing this problem with the AsyncAppender
when I upgraded to the latest version (0.10.0).

(2) According to the following bug description, the AsyncAppender, when
under load, will cause logging threads to deadlock and hang:

    [#LOGCXX-129] Asyncappender is full of race conditions (improper use
of condition variables) - ASF JIRA
    http://issues.apache.org/jira/browse/LOGCXX-129

Hve you experienced this problem?  (Of course, if you are using log4cxx
0.9.7, then you shouldn't have this problem either.)

Thanks again,

Moshe


> -----Original Message-----
> From: George Uecker [mailto:george.uecker@dot21rts.com] 
> Sent: Tuesday, June 26, 2007 4:40 PM
> To: Log4CXX User
> Subject: Re: AsyncAppender not working
> 
> Moshe,
> 
> Here's a copy of my config file.  It configures two different 
> AsyncAppenders, one for the ConsoleAppender and one for our 
> custom DDSAppender.  (The one shown for the FileAppender is 
> commented out in the root section.) Works fine.
> 
> HTH,
> 
> George
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4cxx:configuration >
> 
> <log4cxx:configuration 
> xmlns:log4cxx="http://jakarta.apache.org/log4cxx/"
>                 configDebug="true">
> 
>         <appender name="ASYNC_CONSOLE" 
> class="org.apache.log4cxx.AsyncAppender">
>                 <appender-ref ref="CONSOLE"/>
>         </appender>
> 
>         <appender name="ASYNC_DDS" 
> class="org.apache.log4cxx.AsyncAppender">
>                 <appender-ref ref="DDS"/>
>         </appender>
> 
>         <!--appender name="ASYNC_FILE" 
> class="org.apache.log4cxx.AsyncAppender">
>                 <appender-ref ref="FILE"/>
>         </appender-->
> 
>         <appender name="CONSOLE" 
> class="org.apache.log4cxx.ConsoleAppender">
>                 <layout class="org.apache.log4cxx.PatternLayout">
>                      <param name="ConversionPattern"
>                             value="%d %-5p [%x] %C{2} (%F:%L) 
> - %m%n"/>
>                 </layout>
>         </appender>
> 
>         <appender name="DDS" class="org.apache.log4cxx.DDSAppender">
>                 <param name="domain" value="21"/>
>                 <!--DDSAppender has no Layout-->
>                 <!--layout class="org.apache.log4cxx.PatternLayout">
>                      <param name="ConversionPattern"
>                             value="%d %-5p [%t] %C{2} (%F:%L) 
> - %m%n"/>
>                 </layout-->
>         </appender>
> 
>         <appender name="FILE" class="org.apache.log4cxx.FileAppender">
>                 <param name="File" value="tempLogFile"/>
>                 <layout class="org.apache.log4cxx.PatternLayout">
>                      <param name="ConversionPattern"
>                             value="%d %-5p [%t] %C{2} (%F:%L) 
> - %m%n"/>
>                 </layout>
>         </appender>
> 
>         <root>
>                 <priority value="debug"/>
>                 <appender-ref ref="ASYNC_CONSOLE"/>
>                 <appender-ref ref="ASYNC_DDS"/>
>                 <!--appender-ref ref="FILE"/-->
>         </root>
> </log4cxx:configuration>
> 
> 
> 
> Moshe Matitya wrote:
> > Unless I'm missing something, it appears to be impossible 
> to configure 
> > log4cxx to use AsyncAppender.  Is there anybody out there who has 
> > actually used it?  If so, can you show me how your config 
> file looks?
> > 
> > Thanks,
> > 
> > Moshe
> > 
> > 
> > 
> >>-----Original Message-----
> >>From: Moshe Matitya [mailto:Moshe.Matitya@Kayote.com]
> >>Sent: Thursday, June 21, 2007 8:40 PM
> >>To: log4cxx-user@logging.apache.org
> >>Subject: AsyncAppender not working
> >>
> >>I have been unable to get the AsyncAppender to work.  For every 
> >>appender that is added to the AsyncAppender, the following error 
> >>message appears:
> >>
> >>    No appender named [<name>] could be found.
> >>
> >>And not surprisingly, no logging happens.
> >>
> >>I whittled this down to a simple example using an 
> AsyncAppender with 
> >>two attached appenders.  Here is the config file:
> >>
> >>    <?xml version="1.0" encoding="UTF-8" ?>
> >>    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> >>
> >>    <log4j:configuration
> >>xmlns:log4j='http://jakarta.apache.org/log4j/'
> >>            debug="true">
> >>
> >>        <appender name="CONSOLE"
> >>                class="org.apache.log4j.ConsoleAppender">
> >>            <layout class="org.apache.log4j.PatternLayout">
> >>                <param name="ConversionPattern"
> >>                        value="%d [%t] %-5p %c - %m%n" />
> >>            </layout>
> >>        </appender>
> >>
> >>        <appender name="FILE"
> >>                class="org.apache.log4j.FileAppender">
> >>            <param name="File" value="Sample.log" />
> >>            <param name="Append" value="false" />
> >>            <layout class="org.apache.log4j.PatternLayout">
> >>                <param name="ConversionPattern"
> >>                        value="%d [%t] %-5p %c - %m%n" />
> >>            </layout>
> >>        </appender>
> >>
> >>        <appender name="ASYNC"
> >>                class="org.apache.log4j.AsyncAppender">
> >>            <param name="LocationInfo" value="true" />
> >>            <appender-ref ref="CONSOLE" />
> >>            <appender-ref ref="FILE" />
> >>        </appender>
> >>
> >>        <root>
> >>            <level value="debug" />
> >>            <appender-ref ref="ASYNC" />
> >>        </root>
> >>
> >>    </log4j:configuration>
> >>
> >>And here is the log4cxx debug output:
> >>
> >>    log4cxx: Threshold ="".
> >>    log4cxx: Level value for root is [debug].
> >>    log4cxx: OptionConverter::toLevel: no class name specified, 
> >>level=[debug]
> >>    log4cxx: root level set to DEBUG
> >>    log4cxx: Class name: [org.apache.log4j.AsyncAppender]
> >>    log4cxx: Setting option name=[LocationInfo], value=[true]
> >>    log4cxx: Attaching appender named [CONSOLE] to appender named 
> >>[ASYNC].
> >>    log4cxx: No appender named [CONSOLE] could be found.
> >>    log4cxx: Attaching appender named [FILE] to appender named 
> >>[ASYNC].
> >>    log4cxx: No appender named [FILE] could be found.
> >>    log4cxx: Adding appender named [ASYNC] to logger [root].
> >>
> >>When I change the root logger's appender from "ASYNC" to 
> "CONSOLE" or 
> >>"FILE"
> >>(i.e., bypassing the AsyncAppender), then everything works fine.
> >>
> >>Am I doing something wrong here?
> >>
> >>I am using log4cxx 0.10.0,
> >>taken from <http://littletux.homelinux.org/log4cxx> on June 21.
> >>I am running Windows XP SP2, with Visual C++ 6.0 SP6.
> >>
> >>Thanks,
> >>
> >>Moshe
> > 
> > 
> > 
> 
> 

Mime
View raw message