Moshe,
After looking a little deeper, I now recall that we did indeed have a similar
problem when we first started using log4cxx. To get our configuration to work,
I had to modify DOMConfigurator according to this post:
http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.devel/851
You'll want to first verify whether these mods are already in the version
you're using...
HTH,
George
George Uecker wrote:
Hi Moshe,
Moshe Matitya wrote:
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).
No, I'm using a snapshot of HEAD from Oct. 2006.
(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.)
I have not experienced this problem, but I also modified AsyncAppender
slightly so that it does not block when its queue gets full. Instead it
just drops any log msgs it can't handle. Log4j's AsyncAppender now has
a configuration switch for blocking or non-blocking behavior, including
a summary of dropped msgs for non-blocking mode, but this functionality
has not been ported to log4cxx yet (that I know of).
Thanks for bringing this bug report to my attention though...
George