<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.comp.apache.logging.log4cxx.user">
    <title>gmane.comp.apache.logging.log4cxx.user</title>
    <link>http://blog.gmane.org/gmane.comp.apache.logging.log4cxx.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2436"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2435"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2434"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2433"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2432"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2431"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2430"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2429"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2428"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2427"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2426"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2425"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2424"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2423"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2422"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2421"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2420"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2419"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2418"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2417"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2436">
    <title>Re: Socket and XMLSocketReceiver</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2436</link>
    <description>Hi Dale,

thanks for your answer and the usefull tips.
I have expected something like this but 2 1/2 years since
the last Chainsaw release is quite a bit too long.
We will see if we use Chainsaw at all.

Cheers
   Stefan

Dale King wrote:


</description>
    <dc:creator>Stefan Borovac</dc:creator>
    <dc:date>2008-08-19T18:02:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2435">
    <title>Re: root node of configuration file</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2435</link>
    <description>

You could modify CONFIGURATION_TAG and other code in domconfigurator.cpp and do 
a custom build, but unless only you are going to be dealing with the resulting 
app, and make it clear that it's not following log4j.dtd, it may bite someone in 
the future.

I use multiple configuration files in a configuration directory.

</description>
    <dc:creator>Jacob L. Anawalt</dc:creator>
    <dc:date>2008-08-19T16:59:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2434">
    <title>Re: Socket and XMLSocketReceiver</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2434</link>
    <description>On Tue, Aug 19, 2008 at 9:26 AM, Stefan.Borovac&lt; at &gt;t-online.de &lt;
Stefan.Borovac&lt; at &gt;t-online.de&gt; wrote:


Yes the following will do it for the current thread. It is on a per thread
basis so needs to be done per thread.

        log4cxx::MDC::put( "application", "my application name" );




This is a known version compatibility issue with the released version of
Chainsaw. The current version of Log4j is the 1.2.x branch which is what
Log4Cxx is a port of. A long while back work was started on a new 1.3 branch
of Log4J. This branch was later abandoned and most of the features ported to
the 1.2.x branch. There are differences between 1.2 and 1.3 that mean that
1.2 serialized location info and MDC properties do not deserialize correctly
in 1.3. The problem is that the currently released version of Chainsaw is
built with the 1.3 branch of Log4J.

For now stick to XMLSocketAppender. Feel free to complain loudly over on the
Log4J forums about this. I find it unbelievable that there has been no new
release of Chainsaw to fix this since the release of Chainsaw 2 1/2 years
ago!

You're welcome to try to build Chainsaw yourself against the 1.2 branch.
Good luck, I've never been able to do it.

Here is more info on this:

http://markmail.org/message/ih7q5rgfckmlowaw#query:log4j%20chainsaw%20MDC+page:1+mid:ny52attu27fglhnl+state:results

</description>
    <dc:creator>Dale King</dc:creator>
    <dc:date>2008-08-19T15:22:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2433">
    <title>Re: root node of configuration file</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2433</link>
    <description>Not without changing the software. I don't understand why you would want
this. You say that it contains other information. The parser ignores any
child elements of the configuration that are not one of the tags it knows
about so you can put other information within the configuration.

On Tue, Aug 19, 2008 at 2:21 AM, Madhu Gowda &lt;madhu.gowda_b&lt; at &gt;yahoo.com&gt;wrote:



</description>
    <dc:creator>Dale King</dc:creator>
    <dc:date>2008-08-19T15:00:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2432">
    <title>Socket and XMLSocketReceiver</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2432</link>
    <description>
Hi All,

I'am using log4cxx 0.10.0 and Chainsaw v2 as a server. On the Chainsaw
side I'am
using a SocketReceiver and a XMLSocketReceiver. Now I have three
beginner questions 
concerning this setup.

1) The events logged by the XMLSocketReceiver are all written to the
"chainsaw-log" tab.
This is somehow ugly. Is it possible to set the "Application property"
such that the XML
messages are going to a different tab? I have found only vague
descriptions on setting
this property (even on the name of the key). 

2) Question (1) is also a problem for the SocketReceiver, well different
tabs are open for
different remote hosts, but an application name is still missing.

3) While it was possible to send the "locationInfo" with the
XMLSocketAppender, the
same does not work on the SocketAppender/SocketReceiver pair, although
the C++ code
suggest that the location info is serialized. Any clou here?

Any help is welcome!

Cheers
  Stefan

P.S.: Here is the Chainsaw config. 

&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;!DOCTYPE log4j:configuration &gt;
&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true"&gt;
   
   &lt;appender name="A2" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;layout class="org.apache.log4j.SimpleLayout"/&gt;
   &lt;/appender&gt;

   &lt;plugin name="SocketReceiver"
class="org.apache.log4j.net.SocketReceiver" style="margin:0px;"&gt;
      &lt;param name="port" value="4560"/ style="margin:0px;"&gt;
      &lt;param name="name" value="mySocketReceiver"/ style="margin:0px;"&gt;
      &lt;param name="threshold" value="TRACE"/ style="margin:0px;"&gt;
   &lt;/plugin&gt;
   
   &lt;plugin name="XMLSocketReceiver"
class="org.apache.log4j.net.XMLSocketReceiver" style="margin:0px;"&gt;
      &lt;param name="decoder" value="org.apache.log4j.xml.XMLDecoder"/
style="margin:0px;"&gt;
      &lt;param name="port" value="4448"/ style="margin:0px;"&gt;
      &lt;param name="name" value="myXMLSocketReceiver"/
style="margin:0px;"&gt;
      &lt;param name="threshold" value="TRACE"/ style="margin:0px;"&gt;
   &lt;/plugin&gt;

   &lt;root&gt;
      &lt;level value="debug"/&gt;
   &lt;/root&gt;

&lt;/log4j:configuration&gt;

And here the C++ config on the client side:

// XML socket stuff +++++++++++++++++++++++++++++++++++++++++++++++
XMLSocketAppenderPtr myXMLSocketAppender( 
new XMLSocketAppender(
LOG4CXX_STR("XXX.XXX.XXX.XXX"),
4448
)
);

XMLLayoutPtr myXMLLayout( new XMLLayout() );
myXMLLayout-&gt;setLocationInfo(true);

myXMLSocketAppender-&gt;setLayout(myXMLLayout);
myXMLSocketAppender-&gt;activateOptions(pool);


// plain socket stuff +++++++++++++++++++++++++++++++++++++++++++++++
SocketAppenderPtr mySocketAppender(
new SocketAppender(
LOG4CXX_STR("XXX.XXX.XXX.XXX"),
4560
)
);
mySocketAppender-&gt;activateOptions(pool);

logger-&gt;addAppender(mySocketAppender);
logger-&gt;addAppender(myXMLSocketAppender);
logger-&gt;setLevel(log4cxx::Level::getDebug());





</description>
    <dc:creator>Stefan.Borovac&lt; at &gt;t-online.de</dc:creator>
    <dc:date>2008-08-19T13:26:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2431">
    <title>root node of configuration file</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2431</link>
    <description>Hi all,

I am using a xml file to configure the logger.
Here, the xml file needs the root node as &lt;log4j:configuration&gt; or &lt;configuration&gt;.

I donot want the root node to be named as &lt;log4j:configuration&gt; or &lt;configuration&gt;, as my configuration file contains some other information also.

Is this possible to keep the root node something other than &lt;log4j:configuration&gt; or &lt;configuration&gt;.

Regards,
Madhu Gowda



      </description>
    <dc:creator>Madhu Gowda</dc:creator>
    <dc:date>2008-08-19T06:21:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2430">
    <title>RE: apr-util-expat</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2430</link>
    <description>Thank you. When I build log4cxx using Visual Studio, it does not
generate expat lib instead I see "xml" library getting generated. So is
it possible that log4cxx may not depend on expat and may depend on
xml.lib? Or do I need to use some flag to explicitly let log4cxx use
expat?

Regards.

-----Original Message-----
From: Curt Arnold [mailto:carnold&lt; at &gt;apache.org] 
Sent: Friday, August 15, 2008 11:50 PM
To: Log4CXX User
Subject: Re: apr-util-expat


On Aug 13, 2008, at 9:19 AM, Mehta, Jenica wrote:


Not quite sure what you are asking and seems like an APR question  
anyway.

If you are building APR using configure and make, it will use a  
previously installed expat.  If you are building using Visual Studio,  
apr-util has an embedded copy of expat that it will compile.


</description>
    <dc:creator>Mehta, Jenica</dc:creator>
    <dc:date>2008-08-19T06:17:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2429">
    <title>RE: Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2429</link>
    <description>I've heard of this SocketServer. I'll have to check it out. Thanks.

 

From: renny.koshy&lt; at &gt;rubixinfotech.com
[mailto:renny.koshy&lt; at &gt;rubixinfotech.com] 
Sent: Monday, August 18, 2008 7:44 AM
To: Log4CXX User
Subject: RE: Is this a bug or user error?

 


Peter - 

We've had the exact same requirement on platform we did, which used
Log4j... and ended up running the included "SocketServer" app and then
logging everything to the socket-server, which actually wrote out the
combined file. 

Renny Koshy
President &amp; CEO

--------------------------------------------
Rubix Information Technologies, Inc.
www.rubixinfotech.com 



"Peter Steele" &lt;psteele&lt; at &gt;maxiscale.com&gt; 

08/18/2008 10:35 AM 

Please respond to
"Log4CXX User" &lt;log4cxx-user&lt; at &gt;logging.apache.org&gt;

To

"Log4CXX User" &lt;log4cxx-user&lt; at &gt;logging.apache.org&gt; 

cc


Subject

RE: Is this a bug or user error?

 






A multi-file-appender would be a great addition. I guess in the meantime
the only solution is to either have all of the applications log to their
own log file or implement a log server. We clearly can't continue to use
the configuration we have now...

-----Original Message-----
From: Curt Arnold [mailto:carnold&lt; at &gt;apache.org] 
Sent: Friday, August 15, 2008 11:27 AM
To: Log4CXX User
Subject: Re: Is this a bug or user error?


On Aug 15, 2008, at 10:59 AM, Peter Steele wrote:


log4cxx's RFAs mimics log4j's RFAs and having multiple independent  
applications attempt to write to the same location is a common  
misconfiguration problem in the log4j world.  There is no mechanism  
(at least using java.io) to detect the situation, so the best we can  
do is to tell people not to do it.

You are apparently running on non-Windows platform.  What is occurring  
is that one application rolls over renaming the previous log file and  
creates the new log file, when other applications decide that it is  
time to roll over, then fail to create the new log file and continue  
to write to their old handle (which has been renamed since they  
originally opened it).

There has been a long stalled initiative to develop a  
MultiFileAppender for log4j which may handle the situation more  
gracefully (not its main objective), but that development has been  
stalled for a year or so.

</description>
    <dc:creator>Peter Steele</dc:creator>
    <dc:date>2008-08-18T16:14:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2428">
    <title>RE: Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2428</link>
    <description>Peter -

We've had the exact same requirement on platform we did, which used 
Log4j... and ended up running the included "SocketServer" app and then 
logging everything to the socket-server, which actually wrote out the 
combined file.

Renny Koshy
President &amp; CEO

--------------------------------------------
Rubix Information Technologies, Inc.
www.rubixinfotech.com



"Peter Steele" &lt;psteele&lt; at &gt;maxiscale.com&gt; 
08/18/2008 10:35 AM
Please respond to
"Log4CXX User" &lt;log4cxx-user&lt; at &gt;logging.apache.org&gt;


To
"Log4CXX User" &lt;log4cxx-user&lt; at &gt;logging.apache.org&gt;
cc

Subject
RE: Is this a bug or user error?






A multi-file-appender would be a great addition. I guess in the meantime
the only solution is to either have all of the applications log to their
own log file or implement a log server. We clearly can't continue to use
the configuration we have now...

-----Original Message-----
From: Curt Arnold [mailto:carnold&lt; at &gt;apache.org] 
Sent: Friday, August 15, 2008 11:27 AM
To: Log4CXX User
Subject: Re: Is this a bug or user error?


On Aug 15, 2008, at 10:59 AM, Peter Steele wrote:


log4cxx's RFAs mimics log4j's RFAs and having multiple independent 
applications attempt to write to the same location is a common 
misconfiguration problem in the log4j world.  There is no mechanism 
(at least using java.io) to detect the situation, so the best we can 
do is to tell people not to do it.

You are apparently running on non-Windows platform.  What is occurring 
is that one application rolls over renaming the previous log file and 
creates the new log file, when other applications decide that it is 
time to roll over, then fail to create the new log file and continue 
to write to their old handle (which has been renamed since they 
originally opened it).

There has been a long stalled initiative to develop a 
MultiFileAppender for log4j which may handle the situation more 
gracefully (not its main objective), but that development has been 
stalled for a year or so.

</description>
    <dc:creator>renny.koshy&lt; at &gt;rubixinfotech.com</dc:creator>
    <dc:date>2008-08-18T14:43:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2427">
    <title>RE: Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2427</link>
    <description>A multi-file-appender would be a great addition. I guess in the meantime
the only solution is to either have all of the applications log to their
own log file or implement a log server. We clearly can't continue to use
the configuration we have now...

-----Original Message-----
From: Curt Arnold [mailto:carnold&lt; at &gt;apache.org] 
Sent: Friday, August 15, 2008 11:27 AM
To: Log4CXX User
Subject: Re: Is this a bug or user error?


On Aug 15, 2008, at 10:59 AM, Peter Steele wrote:


log4cxx's RFAs mimics log4j's RFAs and having multiple independent  
applications attempt to write to the same location is a common  
misconfiguration problem in the log4j world.  There is no mechanism  
(at least using java.io) to detect the situation, so the best we can  
do is to tell people not to do it.

You are apparently running on non-Windows platform.  What is occurring  
is that one application rolls over renaming the previous log file and  
creates the new log file, when other applications decide that it is  
time to roll over, then fail to create the new log file and continue  
to write to their old handle (which has been renamed since they  
originally opened it).

There has been a long stalled initiative to develop a  
MultiFileAppender for log4j which may handle the situation more  
gracefully (not its main objective), but that development has been  
stalled for a year or so.

</description>
    <dc:creator>Peter Steele</dc:creator>
    <dc:date>2008-08-18T14:35:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2426">
    <title>RE: RollingFileAppender question</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2426</link>
    <description>Hmmm, that justmight do the trick. Thanks for the suggestion...

 

From: Chris D'Annunzio [mailto:ChrisD&lt; at &gt;verdiem.com] 
Sent: Friday, August 15, 2008 11:00 AM
To: Log4CXX User
Subject: RE: RollingFileAppender question

 

You could manually trigger a rollover when the application starts up. We
do something similar in our application when the user wants to clear the
log files.

 

      log4cxx::LoggerPtr pLogger = log4cxx::Logger::getRootLogger();

      log4cxx::AppenderPtr pAppender =
pLogger-&gt;getAppender(LOG_FILEAPPENDER_NAME);

      

      if (pAppender)

      {

            // Down cast so we have access tot he rolling file
appender's methods

            log4cxx::helpers::ObjectPtrT&lt;log4cxx::RollingFileAppender&gt;
pRFAppender = pAppender;

            log4cxx::helpers::Pool pool;

            pRFAppender-&gt;rollover(pool);

      }

 

That will trigger a log file rollover. So, you could configure the
appender with Append = true and then trigger a rollover when the
application first starts up. You might need a special case when the
application starts for the first time if you don't want an extra empty
log file, but hope this gets you closer.

 

-Chris

 

________________________________

From: Peter Steele [mailto:psteele&lt; at &gt;maxiscale.com] 
Sent: Thursday, August 14, 2008 10:24 AM
To: Log4CXX User
Subject: RollingFileAppender question

 

We are using a RollingFileAppender defined as follows:

 

   &lt;appender name="FILE" class="org.apache.log4j.RollingFileAppender"&gt;

       &lt;param name="maxFileSize" value="200MB" /&gt;

       &lt;param name="maxBackupIndex" value="12" /&gt;

       &lt;param name="File" value="${LOGNAME}" /&gt;

       &lt;param name="Append" value="false"/&gt;

       &lt;layout class="org.apache.log4j.PatternLayout"&gt;

           &lt;param name="ConversionPattern"

               value="%d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n" /&gt;

       &lt;/layout&gt;

   &lt;/appender&gt;

 

This works the way we want with one exception: When our app that uses
this appender starts up it overwrites the existing log file. This is of
course because we have Append set to false. What we'd like to have
happen is that if there is an existing log file have a rollover occur
immediately so that no log data is lost. Can that be setup or is our
only option is to set Append to true?

 

</description>
    <dc:creator>Peter Steele</dc:creator>
    <dc:date>2008-08-16T18:13:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2425">
    <title>Re: Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2425</link>
    <description>
On Aug 15, 2008, at 10:59 AM, Peter Steele wrote:


log4cxx's RFAs mimics log4j's RFAs and having multiple independent  
applications attempt to write to the same location is a common  
misconfiguration problem in the log4j world.  There is no mechanism  
(at least using java.io) to detect the situation, so the best we can  
do is to tell people not to do it.

You are apparently running on non-Windows platform.  What is occurring  
is that one application rolls over renaming the previous log file and  
creates the new log file, when other applications decide that it is  
time to roll over, then fail to create the new log file and continue  
to write to their old handle (which has been renamed since they  
originally opened it).

There has been a long stalled initiative to develop a  
MultiFileAppender for log4j which may handle the situation more  
gracefully (not its main objective), but that development has been  
stalled for a year or so.
</description>
    <dc:creator>Curt Arnold</dc:creator>
    <dc:date>2008-08-15T18:26:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2424">
    <title>Re: apr-util-expat</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2424</link>
    <description>
On Aug 13, 2008, at 9:19 AM, Mehta, Jenica wrote:


Not quite sure what you are asking and seems like an APR question  
anyway.

If you are building APR using configure and make, it will use a  
previously installed expat.  If you are building using Visual Studio,  
apr-util has an embedded copy of expat that it will compile.


</description>
    <dc:creator>Curt Arnold</dc:creator>
    <dc:date>2008-08-15T18:20:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2423">
    <title>RE: RollingFileAppender question</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2423</link>
    <description>You could manually trigger a rollover when the application starts up. We
do something similar in our application when the user wants to clear the
log files.

 

      log4cxx::LoggerPtr pLogger = log4cxx::Logger::getRootLogger();

      log4cxx::AppenderPtr pAppender =
pLogger-&gt;getAppender(LOG_FILEAPPENDER_NAME);

      

      if (pAppender)

      {

            // Down cast so we have access tot he rolling file
appender's methods

            log4cxx::helpers::ObjectPtrT&lt;log4cxx::RollingFileAppender&gt;
pRFAppender = pAppender;

            log4cxx::helpers::Pool pool;

            pRFAppender-&gt;rollover(pool);

      }

 

That will trigger a log file rollover. So, you could configure the
appender with Append = true and then trigger a rollover when the
application first starts up. You might need a special case when the
application starts for the first time if you don't want an extra empty
log file, but hope this gets you closer.

 

-Chris

 

________________________________

From: Peter Steele [mailto:psteele&lt; at &gt;maxiscale.com] 
Sent: Thursday, August 14, 2008 10:24 AM
To: Log4CXX User
Subject: RollingFileAppender question

 

We are using a RollingFileAppender defined as follows:

 

   &lt;appender name="FILE" class="org.apache.log4j.RollingFileAppender"&gt;

       &lt;param name="maxFileSize" value="200MB" /&gt;

       &lt;param name="maxBackupIndex" value="12" /&gt;

       &lt;param name="File" value="${LOGNAME}" /&gt;

       &lt;param name="Append" value="false"/&gt;

       &lt;layout class="org.apache.log4j.PatternLayout"&gt;

           &lt;param name="ConversionPattern"

               value="%d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n" /&gt;

       &lt;/layout&gt;

   &lt;/appender&gt;

 

This works the way we want with one exception: When our app that uses
this appender starts up it overwrites the existing log file. This is of
course because we have Append set to false. What we'd like to have
happen is that if there is an existing log file have a rollover occur
immediately so that no log data is lost. Can that be setup or is our
only option is to set Append to true?

 

</description>
    <dc:creator>Chris D'Annunzio</dc:creator>
    <dc:date>2008-08-15T18:00:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2422">
    <title>Re: Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2422</link>
    <description>
Interesting that some fail to roll over and close the old file handle.


I think it would be better to have individual processes write to a log server, 
either a log4cxx capable one that can read a config file and filter or a "dumb" 
one, and have a single log server write to the log file.

</description>
    <dc:creator>Jacob L. Anawalt</dc:creator>
    <dc:date>2008-08-15T16:18:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2421">
    <title>Is this a bug or user error?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2421</link>
    <description>We use the DailyRollingAppender, defined as follows in our config file:

 

   &lt;appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender"&gt;

      &lt;errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/&gt;

      &lt;param name="File" value="&lt;logfile&gt;"/&gt;

      &lt;param name="Append" value="true"/&gt;

 

      &lt;!-- Rollover at midnight each day --&gt;

      &lt;param name="DatePattern" value="'.'yyyy-MM-dd"/&gt;

 

     &lt;layout class="org.apache.log4j.PatternLayout"&gt;

       &lt;param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/&gt;

     &lt;/layout&gt;

   &lt;/appender&gt;

 

Several applications log to the same log file using this appender.
What's happening is when the rollover occurs at midnight, some processes
still log to the original file, which has now been renamed, whereas
others log to the main log file as they should. I'm suspecting that this
is an error on our part and we should not have multiple processes all
log to the same file, although I've heard that others do this. What's
the solution?

 

</description>
    <dc:creator>Peter Steele</dc:creator>
    <dc:date>2008-08-15T15:59:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2420">
    <title>Autodetection of libs and includes flags / Automake macro?</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2420</link>
    <description>Hi,

I would like to integrate lib4cxx into my project, which uses automake 
for the build-process. How can I automatically detect if lib4cxx is 
installed and which lib and include flags I have to use? I am thinking 
of either a nice automake .m4 macro like the find_apr.m4, or a config 
program, which gives the needed information (e.g. pkg-config or apr-config).

Best regards,

Heiko

</description>
    <dc:creator>Heiko Klein</dc:creator>
    <dc:date>2008-08-15T12:22:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2419">
    <title>RollingFileAppender question</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2419</link>
    <description>We are using a RollingFileAppender defined as follows:

 

   &lt;appender name="FILE" class="org.apache.log4j.RollingFileAppender"&gt;

       &lt;param name="maxFileSize" value="200MB" /&gt;

       &lt;param name="maxBackupIndex" value="12" /&gt;

       &lt;param name="File" value="${LOGNAME}" /&gt;

       &lt;param name="Append" value="false"/&gt;

       &lt;layout class="org.apache.log4j.PatternLayout"&gt;

           &lt;param name="ConversionPattern"

               value="%d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n" /&gt;

       &lt;/layout&gt;

   &lt;/appender&gt;

 

This works the way we want with one exception: When our app that uses
this appender starts up it overwrites the existing log file. This is of
course because we have Append set to false. What we'd like to have
happen is that if there is an existing log file have a rollover occur
immediately so that no log data is lost. Can that be setup or is our
only option is to set Append to true?

 

</description>
    <dc:creator>Peter Steele</dc:creator>
    <dc:date>2008-08-14T17:24:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2418">
    <title>apr-util-expat</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2418</link>
    <description>Hi,

 

Any idea if expat project inside apr-util, has a separate project called
XML. 

Apr-util depends on expat libs or xml lib? Or under some condition?

 

Jenica Mehta

</description>
    <dc:creator>Mehta, Jenica</dc:creator>
    <dc:date>2008-08-13T14:19:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2417">
    <title>Adapt an existing FileAppender</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2417</link>
    <description>Hey *,

I have found the following two lines of code to adapt an existing
FileAppender:

 

Appender* appender = Logger::getRootLogger()-&gt;getAppender
("RollingFile");
FileAppender* fa = dynamic_cast&lt;FileAppender*&gt;(appender);

 

But when I try to implement this functionylity in my method I get always
an dynamic_cast exception, here is my code snippet:

 

std::string errorLogFile = "test.log";

const log4cxx::LogString rootLoggerFileAppenderName =
LOG4CXX_STR("RootLoggerFileAppender"); 

...

std::wstring logFilePathName(errorLogFile.begin(), errorLogFile.end());

log4cxx::Appender* rootFileAppender =
log4cxx::Logger::getRootLogger()-&gt;getAppender(rootLoggerFileAppenderName
);

if(rootFileAppender == 0 || rootFileAppender == NULL)

{

      log4cxx::LogString logStringFormat = LOG4CXX_STR("[%-5p] - %m%n");

      log4cxx::LayoutPtr layout(new
log4cxx::PatternLayout(logStringFormat));

      rootFileAppender = new log4cxx::FileAppender(layout,
logFilePathName, true);

      rootFileAppender-&gt;setName(LOG4CXX_STR("RollingFile"));

      log4cxx::Logger::getRootLogger()-&gt;addAppender(rootFileAppender);}

 

/* the following dynamic_cast throws an exception */

try

{

 
dynamic_cast&lt;log4cxx::FileAppender*&gt;(rootFileAppender)-&gt;setFile(logFileP
athName);

}

catch(...)

{

 
log4cxx::Logger::getRootLogger()-&gt;removeAppender(rootLoggerFileAppenderN
ame);

      log4cxx::BasicConfigurator::configure();

      LOG4CXX_ERROR(m_logger, "FileAppender couldn't be configured for
root logger, invalid log file specified: " &lt;&lt; errorLogFile);

      LOG4CXX_ERROR(m_logger, "A ConsoleAppender was added to the root
logger instead of the FileAppender.");

      return 1;

}

 

Where is my bug?

 

Thanks for any respons

Markus

</description>
    <dc:creator>Eberhard, Markus (external</dc:creator>
    <dc:date>2008-08-07T14:15:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2416">
    <title>RE: Upgrading from 0.9.7 to 0.10.0 - Pool Information</title>
    <link>http://permalink.gmane.org/gmane.comp.apache.logging.log4cxx.user/2416</link>
    <description>Thanks for the reply Curt. I understand how it works now.

Best,
Chris

-----Original Message-----
From: Curt Arnold [mailto:carnold&lt; at &gt;apache.org] 
Sent: Monday, August 04, 2008 11:01 PM
To: Log4CXX User
Subject: Re: Upgrading from 0.9.7 to 0.10.0 - Pool Information


On Aug 1, 2008, at 4:39 PM, Chris D'Annunzio wrote:



Pool parameters are a memory pool that is used for just that  
operation.  No memory or other resource from that pool is expected to  
live beyond the duration of the call.  You could either create a new  
subpool of the global pool for each call:

    log4cxx::helpers::Pool p;
    appender-&gt;activateOptions(p);

or share the same pool between multiple calls:

    log4cxx::helpers::Pool p;
    //   whatever loop you may already have in your program
    for(std::vector&lt;AppenderPtr&gt;::interator iter = appenders.begin();  
iter != appender.end(); iter++) {
(*iter)-&gt;activateOptions(p);
    }

The Pool constructor calls apr_pool_create() and the destructor calls  
apr_pool_destroy.



</description>
    <dc:creator>Chris D'Annunzio</dc:creator>
    <dc:date>2008-08-06T18:16:08</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.comp.apache.logging.log4cxx.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.apache.logging.log4cxx.user</link>
  </textinput>
</rdf:RDF>
