logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan.Borovac@t-online.de" <Stefan.Boro...@t-online.de>
Subject AsynchAppender, XMLSocketAppender and fast dying application
Date Thu, 04 Sep 2008 13:20:34 GMT

Hi All,

I'am currently working with log4cxx 0.10.0 on W-XP using MSVC 2005 Group
Edition.
The problem I have is the following. I use an AnsycAppender which uses
an 
XMLSocketAppender to publish events. 

When my application is going to terminate in the main method and no
event was send to the server
(chainsaw at the moment), the application hangs while performing
"LogManager::shutdown();" and
does not terminate.

What I figured out so far is, that the XMLLayout is using
"log4cxx::helpers::Transform::appendEscapingCDATA" 
which initialises some static variables. This initialisation interferes
with an "atexit" handler. The result 
is, that appendEscapingCDATA never returns. Hence, the thread of the
AsyncAppender never returns and the
whole application does not terminate.

A remedy is to perform the initialisation in advance, like this:

      {
        LogString buf;
        LogString input;
        log4cxx::helpers::Transform::appendEscapingCDATA(buf, input);
      }

This helps, but is not very intentional. Are there nicer solutions
available (a sleep also
works, but one needs different periods in RELEASE/DEBUG mode)?

Cheers
  Stefan



Mime
View raw message