<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>log4cxx-dev@logging.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/</id>
<updated>2009-12-08T01:28:20Z</updated>
<entry>
<title>svn commit: r807031 - in /logging/log4cxx/trunk/src: changes/changes.xml main/cpp/transcoder.cpp test/cpp/helpers/transcodertestcase.cpp</title>
<author><name>carnold@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200908.mbox/%3c20090823232438.A80E42388878@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090823232438-A80E42388878@eris-apache-org%3e</id>
<updated>2009-08-23T23:24:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: carnold
Date: Sun Aug 23 23:24:37 2009
New Revision: 807031

URL: http://svn.apache.org/viewvc?rev=807031&amp;view=rev
Log:
LOGCXX-340: Transcoder::encodeCharsetName bungles encoding

Modified:
    logging/log4cxx/trunk/src/changes/changes.xml
    logging/log4cxx/trunk/src/main/cpp/transcoder.cpp
    logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp

Modified: logging/log4cxx/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/changes/changes.xml?rev=807031&amp;r1=807030&amp;r2=807031&amp;view=diff
==============================================================================
--- logging/log4cxx/trunk/src/changes/changes.xml (original)
+++ logging/log4cxx/trunk/src/changes/changes.xml Sun Aug 23 23:24:37 2009
@@ -22,7 +22,7 @@
 &lt;title&gt;Apache log4cxx&lt;/title&gt;
 &lt;/properties&gt;
 &lt;body&gt;
-&lt;release version="0.11.0" date="2008-XX-XX" description="Maintenance release"&gt;
+&lt;release version="0.11.0" date="2009-XX-XX" description="Maintenance release"&gt;
 &lt;action issue="LOGCXX-249"&gt;Console appender crashes if layout is not set&lt;/action&gt;
 &lt;action issue="LOGCXX-262"&gt;socketappendertestcase and xmlsocketappendertestcase not
run&lt;/action&gt;
 &lt;action issue="LOGCXX-263"&gt;Bad link to log4cxx-dev archive&lt;/action&gt;
@@ -52,6 +52,7 @@
 &lt;action issue="LOGCXX-300"&gt;ODBCAppender connection settings broken (or just have changed).&lt;/action&gt;
 &lt;action issue="LOGCXX-303"&gt;DOMConfigurator does not set ErrorHandler.&lt;/action&gt;
 &lt;action issue="LOGCXX-304"&gt;BasicConfigurator::configure results in writer not set warning.&lt;/action&gt;
+&lt;action issue="LOGCXX-340"&gt;Transcoder::encodeCharsetName bungles encoding&lt;/action&gt;
 &lt;/release&gt;
 &lt;release version="0.10.0" date="2008-04-03" description="First Apache release"&gt;
 &lt;action issue="LOGCXX-2"&gt;logger.h includes config.h&lt;/action&gt;

Modified: logging/log4cxx/trunk/src/main/cpp/transcoder.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/transcoder.cpp?rev=807031&amp;r1=807030&amp;r2=807031&amp;view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/transcoder.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/transcoder.cpp Sun Aug 23 23:24:37 2009
@@ -523,13 +523,13 @@
                            '@', 'A', 'B', 'C', 'D', 'E', 'F',  'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O',
                            'P', 'Q', 'R', 'S', 'T', 'U', 'V',  'W', 'X', 'Y', 'Z', '[', '\\',
']', '^', '_',
                            '`', 'a', 'b', 'c', 'd', 'e', 'f',  'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o',
-                           'p', 'q', 'r', 's', 't', 'u', 'v',  'w', 'x', 'y', 'z', '{', '|',
'}', '~', ' ' };
+                           'p', 'q', 'r', 's', 't', 'u', 'v',  'w', 'x', 'y', 'z', '{', '|',
'}', '~' };
     std::string out;
     for(LogString::const_iterator iter = val.begin();
         iter != val.end();
         iter++) {
-        if (*iter &gt;= 0x30 &amp;&amp; *iter &lt; 0x7F) {
-            out.append(1, asciiTable[*iter - 0x30]);
+        if (*iter &gt;= 0x20 &amp;&amp; *iter &lt; 0x7F) {
+            out.append(1, asciiTable[*iter - 0x20]);
         } else {
             out.append(1, LOSSCHAR);
         }

Modified: logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp?rev=807031&amp;r1=807030&amp;r2=807031&amp;view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/transcodertestcase.cpp Sun Aug 23 23:24:37
2009
@@ -60,7 +60,9 @@
                 LOGUNIT_TEST(uencode3);
                 LOGUNIT_TEST(uencode5);
 #endif
-                
+                LOGUNIT_TEST(encodeCharsetName1);
+                LOGUNIT_TEST(encodeCharsetName2);
+                LOGUNIT_TEST(encodeCharsetName3);                
         LOGUNIT_TEST_SUITE_END();
 
 
@@ -304,6 +306,34 @@
 #endif
 
 
+        void encodeCharsetName1() {
+            const logchar utf8[] = { 0x75, 0x74, 0x66, 0x2D, 0x38, 0x00 };
+            std::string encoded(Transcoder::encodeCharsetName(LogString(utf8)));
+            LOGUNIT_ASSERT_EQUAL(std::string("utf-8"), encoded);
+        }
+        
+        void encodeCharsetName2() {
+            logchar lascii[0x60];
+            char ascii[0x60];
+            for(int i = 0; i &lt; 0x5F; i++) {
+                lascii[i] = i + 0x20;
+                ascii[i] = i + 0x20;
+            }
+            lascii[0x5F] = 0;
+            ascii[0x5F] = 0;
+            std::string encoded(Transcoder::encodeCharsetName(LogString(ascii)));
+            LOGUNIT_ASSERT_EQUAL(std::string(" !\"#$%&amp;'()*+,-./"), encoded.substr(0,
0x10));
+            if (0x40 == 'A') {
+                LOGUNIT_ASSERT_EQUAL(std::string(ascii), encoded);
+            }
+        }
+
+        void encodeCharsetName3() {
+            logchar unsupported[] = { 0x1F, 0x7F, 0x80, 0x81, 0x00 };
+            std::string encoded(Transcoder::encodeCharsetName(LogString(unsupported)));
+            LOGUNIT_ASSERT_EQUAL(std::string("????"), encoded);
+        }
+
 };
 
 LOGUNIT_TEST_SUITE_REGISTRATION(TranscoderTestCase);




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in	ObjectPtrBase</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200907.mbox/%3c5d5d09c0907292256k19b52845n91b990b932c5e35c@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0907292256k19b52845n91b990b932c5e35c@mail-gmail-com%3e</id>
<updated>2009-07-30T05:56:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Use  apr, apr-util, expat, log4cxx libraries compiled with -fPIC flag.
It works in my case.

On Thu, Jul 30, 2009 at 9:06 AM, Curt Arnold &lt;carnold@apache.org&gt; wrote:

&gt;
&gt; On Jul 16, 2009, at 7:43 AM, abgimeno wrote:
&gt;
&gt;
&gt;&gt; Hi
&gt;&gt;
&gt;&gt; I have the same problem and I could not solve. I have installed the
&gt;&gt; version
&gt;&gt; apache-log4cxx-0.10.0. apr-1.3.6 and apr-util-1.3.8. in a Red Hat 5 x64
&gt;&gt;
&gt;&gt; I tried with the patch 596934 and does not work.
&gt;&gt;
&gt;&gt;
&gt;&gt; When the program ends gives an exception
&gt;&gt;
&gt;&gt; terminate called after throwing an instance of
&gt;&gt; 'log4cxx::helpers::MutexException'
&gt;&gt;  what():  Mutex exception: stat = 22
&gt;&gt; ./tester.sh: line 71: 17226 Aborted                 ./tester
&gt;&gt;
&gt;&gt;
&gt; I'l try to fire up a copy of CentOS 5 x64 this weekend.
&gt;
&gt; Did it occur during the unit tests or one of the sample applications, or in
&gt; some other context?
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in ObjectPtrBase</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200907.mbox/%3c993D41B4-CCCD-4775-BA23-B479D5FD1158@apache.org%3e"/>
<id>urn:uuid:%3c993D41B4-CCCD-4775-BA23-B479D5FD1158@apache-org%3e</id>
<updated>2009-07-30T03:36:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jul 16, 2009, at 7:43 AM, abgimeno wrote:

&gt;
&gt; Hi
&gt;
&gt; I have the same problem and I could not solve. I have installed the  
&gt; version
&gt; apache-log4cxx-0.10.0. apr-1.3.6 and apr-util-1.3.8. in a Red Hat 5  
&gt; x64
&gt;
&gt; I tried with the patch 596934 and does not work.
&gt;
&gt;
&gt; When the program ends gives an exception
&gt;
&gt; terminate called after throwing an instance of
&gt; 'log4cxx::helpers::MutexException'
&gt;  what():  Mutex exception: stat = 22
&gt; ./tester.sh: line 71: 17226 Aborted                 ./tester
&gt;

I'l try to fire up a copy of CentOS 5 x64 this weekend.

Did it occur during the unit tests or one of the sample applications,  
or in some other context?


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in ObjectPtrBase</title>
<author><name>abgimeno &lt;arturobernalg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200907.mbox/%3c24515613.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24515613-post@talk-nabble-com%3e</id>
<updated>2009-07-16T12:43:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi

I have the same problem and I could not solve. I have installed the version
apache-log4cxx-0.10.0. apr-1.3.6 and apr-util-1.3.8. in a Red Hat 5 x64

I tried with the patch 596934 and does not work.

    
When the program ends gives an exception

terminate called after throwing an instance of
'log4cxx::helpers::MutexException'
  what():  Mutex exception: stat = 22
./tester.sh: line 71: 17226 Aborted                 ./tester



Rhosyn wrote:
&gt; 
&gt; The attach patch fixes a thread safety issue we found with ObjectPtrBase
&gt; when we ported our application to a 64 bit platform.
&gt; 
&gt; It will only work if you are using a version of apr with
&gt; apr_atomic_xchgptr()
&gt; 
&gt; 
&gt; Cheers
&gt; 
&gt; 
&gt; 
&gt; ______________________________________________________________________
&gt; This email has been scanned by the MessageLabs Email Security System.
&gt; For more information please visit http://www.messagelabs.com/email 
&gt; ______________________________________________________________________
&gt; ---
&gt; /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.host/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp
&gt; 2008-03-31 23:34:09.000000000 +0100
&gt; +++
&gt; /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.app/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp
&gt; 2009-01-07 15:39:03.000000000 +0000
&gt; @@ -36,12 +36,7 @@
&gt;  void* ObjectPtrBase::exchange(void** destination, void* newValue) {
&gt;  #if _WIN32 &amp;&amp; (!defined(_MSC_VER) || _MSC_VER &gt;= 1300)
&gt;      return InterlockedExchangePointer(destination, newValue);
&gt; -#elif APR_SIZEOF_VOIDP == 4
&gt; -   return (void*) apr_atomic_xchg32((volatile apr_uint32_t*) destination,
&gt; -                          (apr_uint32_t) newValue);
&gt;  #else
&gt; -   void* oldValue = *destination;
&gt; -   *destination = newValue;
&gt; -   return oldValue;
&gt; +   apr_atomic_xchgptr((volatile void**)destination, newValue);
&gt;  #endif
&gt;  }
&gt; 
&gt; 

-- 
View this message in context: http://www.nabble.com/log4cxx-0.10.0%3A-Fix-for-64-bit-only-thread-safety-bug-in-ObjectPtrBase-tp21504865p24515613.html
Sent from the Log4cxx - Dev mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in ObjectPtrBase</title>
<author><name>abgimeno &lt;arturobernalg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200907.mbox/%3c24512413.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c24512413-post@talk-nabble-com%3e</id>
<updated>2009-07-16T08:28:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


Hi

I have the same problem and I could not solve. I have installed the version
apache-log4cxx-0.10.0. apr-1.3.6 and apr-util-1.3.8. in a Red Hat 5 x64

I tried with the patch 596934 and does not work.

    
When the program ends gives an exception

terminate called after throwing an instance of
'log4cxx::helpers::MutexException'
  what():  Mutex exception: stat = 22
./tester.sh: line 71: 17226 Aborted                 ./tester


Rhosyn wrote:
&gt; 
&gt; The attach patch fixes a thread safety issue we found with ObjectPtrBase
&gt; when we ported our application to a 64 bit platform.
&gt; 
&gt; It will only work if you are using a version of apr with
&gt; apr_atomic_xchgptr()
&gt; 
&gt; 
&gt; Cheers
&gt; 
&gt; 
&gt; 
&gt; ______________________________________________________________________
&gt; This email has been scanned by the MessageLabs Email Security System.
&gt; For more information please visit http://www.messagelabs.com/email 
&gt; ______________________________________________________________________
&gt; ---
&gt; /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.host/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp
&gt; 2008-03-31 23:34:09.000000000 +0100
&gt; +++
&gt; /home/rhosyn/SVN/oakx41/main/thirdparty/log4cxx/_build/app.app/app/apache-log4cxx-0.10.0/src/main/cpp/objectptr.cpp
&gt; 2009-01-07 15:39:03.000000000 +0000
&gt; @@ -36,12 +36,7 @@
&gt;  void* ObjectPtrBase::exchange(void** destination, void* newValue) {
&gt;  #if _WIN32 &amp;&amp; (!defined(_MSC_VER) || _MSC_VER &gt;= 1300)
&gt;      return InterlockedExchangePointer(destination, newValue);
&gt; -#elif APR_SIZEOF_VOIDP == 4
&gt; -   return (void*) apr_atomic_xchg32((volatile apr_uint32_t*) destination,
&gt; -                          (apr_uint32_t) newValue);
&gt;  #else
&gt; -   void* oldValue = *destination;
&gt; -   *destination = newValue;
&gt; -   return oldValue;
&gt; +   apr_atomic_xchgptr((volatile void**)destination, newValue);
&gt;  #endif
&gt;  }
&gt; 
&gt; 

-- 
View this message in context: http://www.nabble.com/log4cxx-0.10.0%3A-Fix-for-64-bit-only-thread-safety-bug-in-ObjectPtrBase-tp21504865p24512413.html
Sent from the Log4cxx - Dev mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Segmentation fault from log4cxx on 64 bit platform</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200907.mbox/%3c5d5d09c0907151111t35e0ec51nf06486010442ae78@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0907151111t35e0ec51nf06486010442ae78@mail-gmail-com%3e</id>
<updated>2009-07-15T18:11:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
  I am getting segmentation fault from log4cxx when running on 64 bit
platform (linux). Though its working fine on 32 bit machine.
  Can you please help me out?

gdb back trace output:---

#0  apr_pool_create_ex (newpool=0x8b1940, parent=0x8b8418, abort_fn=0,
allocator=0x8b4300) at memory/unix/apr_pools.c:249
#1  0x00000000005a5e20 in Pool (this=0x8b1940) at pool.cpp:34
#2  0x00000000005bda4d in
log4cxx::helpers::CharsetEncoder::createDefaultEncoder () at
charsetencoder.cpp:370
#3  0x00000000005be0f3 in
log4cxx::helpers::CharsetEncoder::getDefaultEncoder () at
charsetencoder.cpp:436
#4  0x00000000005b5772 in log4cxx::helpers::Transcoder::encode
(src=@0x7fbffff300, dst=@0x7fbffff2c0) at transcoder.cpp:288
#5  0x00000000005aee83 in log4cxx::helpers::SystemErrWriter::write
(str=@0x7fbffff300) at systemerrwriter.cpp:67
#6  0x00000000005b661f in log4cxx::WriterAppender::writeFooter
(this=0x8c2330, p=@0x8c2398) at writerappender.cpp:227
#7  0x00000000005b6842 in log4cxx::WriterAppender::closeWriter
(this=0x8c2330) at writerappender.cpp:157
#8  0x00000000005b69ff in log4cxx::WriterAppender::close (this=0x8c2330) at
writerappender.cpp:143
#9  0x000000000058815d in ~ConsoleAppender (this=0x0) at
consoleappender.cpp:57
#10 0x00000000004e9601 in ~ObjectPtrT (this=0x8c22e0) at
../../../src/main/include/log4cxx/helpers/objectptr.h:100
#11 0x00000000005b9aad in ~AppenderAttachableImpl (this=0x8c2940)
#12 0x0000000000590905 in ~Logger (this=0x8bc4c0, __vtt_parm=&lt;value
optimized out&gt;) at ../../../src/main/include/log4cxx/helpers/objectptr.h:100
#13 0x00000000005fa9ca in ~RootLogger (this=0x0) at
../../../src/main/include/log4cxx/spi/rootlogger.h:37
#14 0x00000000004e75ba in ~CdxMsgrC (this=0x88fc00) at
/usr/releng/external/log4cxx-0.10.0/include/log4cxx/helpers/objectptr.h:100
#15 0x00000000004e805a in __static_initialization_and_destruction_0
(__initialize_p=&lt;value optimized out&gt;, __priority=21)
#16 0x00000000004d724d in __do_global_dtors_aux ()
#17 0x0000007fbffff618 in ?? ()
#18 0x00000000006ba1bd in _fini ()
#19 0x0000007fbffff618 in ?? ()
#20 0x0000002a95c6ec85 in exit () from /lib64/tls/libc.so.6
#21 0x00000000004dac28 in main (argc=&lt;value optimized out&gt;,
argv=0x7fbffff618)


</pre>
</div>
</content>
</entry>
<entry>
<title>log4cxx::NDC::cloneStack() and inherit() functions missing in 0.10.0</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c5d5d09c0906231125u6265215cgc2481233f477344f@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0906231125u6265215cgc2481233f477344f@mail-gmail-com%3e</id>
<updated>2009-06-23T18:25:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt;
&gt; hi,
&gt;    log4cxx::NDC::cloneStack() and inherit() functions are missing from
&gt; 0.10.0.
&gt;    Is there any work around for these functions in the 0.10.0.
&gt;    I want to inherit the NDC stack of the parent thread to the child
&gt; thread.
&gt;
    Thanks
    Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>cloneStack() and inherit() functions missing in 0.10.0</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c5d5d09c0906230523t4993094ey9836308a6e73644e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0906230523t4993094ey9836308a6e73644e@mail-gmail-com%3e</id>
<updated>2009-06-23T12:23:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
hi,
   log4cxx::NDC::cloneStack() and inherit() functions are missing from
0.10.0.
   Is there any work around for these functions in the 0.10.0.
   I want to inherit the NDC stack of the parent thread to the child thread.
Thanks
Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>NDC stack of parent thread visible to child thread??</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c5d5d09c0906230432m6b6573e4tda208f451725d7e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0906230432m6b6573e4tda208f451725d7e@mail-gmail-com%3e</id>
<updated>2009-06-23T11:32:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
  Is there any way through which I can inherit the NDC stack to the child
thread?
  I have a parent thread running and create a child thread, I want the NDC
stack of the parentthread
  should also be applied to the child thread.
  Please let me know if we have anyway to do that?
Thnaks
Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>Issue with using NDC (nested diagnostic contexts)</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c5d5d09c0906150511s7a1f5706w16c4700433ad3174@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0906150511s7a1f5706w16c4700433ad3174@mail-gmail-com%3e</id>
<updated>2009-06-15T12:11:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
  I am using NDC (*nested diagnostic contexts*) for appending the text from
a specific thread.
  Using floowing code:

-------------------------
 //In side the run method of that thread
  log4cxx::NDC::push("Thread specific Info");

  printing some log4cxx messages.......

 //Just before exiting the thread
 log4cxx::NDC::pop();
-------------------------------

But the issue is I am not able to get the "Thread specific Info" message in
any of the messages I am printing in that thread.
I am using log4cxx 0.10.0 version.
Please let me know if you have any idea.

Thanks
Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: New appender for log4cxx</title>
<author><name>George Morgan &lt;gm.vtee@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c550236570906090724q9ae0d29qa8fb14b2e2ca4c4d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c550236570906090724q9ae0d29qa8fb14b2e2ca4c4d@mail-gmail-com%3e</id>
<updated>2009-06-09T14:24:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Tue, Jun 9, 2009 at 8:48 AM, Curt Arnold&lt;carnold@apache.org&gt; wrote:
&gt;
&gt; On Jun 8, 2009, at 11:05 AM, George Morgan wrote:
&gt;
&gt;&gt; I'm planning to use libstrophe for the XMPP interface and was
&gt;&gt; wondering what I need to ask the author of that library in order to
&gt;&gt; not preclude inclusion of my code in log4cxx?
&gt;
&gt; The standard distribution is licensed under the GPL.  See
&gt; http://www.apache.org/licenses/GPL-compatibility.html for why Apache
&gt; projects can't link to GPL licensed projects.  Apache, BSD or MIT style
&gt; licenses are not a problem.

I'm guessing that LGPL would not be compatible either then...  I'm
going to talk to the copyright owner for libstrophe and see if there
is a chance that he would change the license.


-- 
George Morgan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: New appender for log4cxx</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c3F3F007B-FA65-4FE3-ACB5-06C1C16D7315@apache.org%3e"/>
<id>urn:uuid:%3c3F3F007B-FA65-4FE3-ACB5-06C1C16D7315@apache-org%3e</id>
<updated>2009-06-09T12:48:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jun 8, 2009, at 11:05 AM, George Morgan wrote:

&gt; I've started porting the IMAppender from log4j-sandbox to log4cxx.  I
&gt; am hoping to produce code which is suitable for inclusion in the
&gt; log4cxx distribution.
&gt;
&gt; Is there is a list of guidelines for inclusion somewhere?
&gt;
&gt; I've looked over the code and was wondering if I should base my new
&gt; appender on the AppenderSkeleton or the SocketAppenderSkeleton?
&gt;
&gt; I'm planning to use libstrophe for the XMPP interface and was
&gt; wondering what I need to ask the author of that library in order to
&gt; not preclude inclusion of my code in log4cxx?

The standard distribution is licensed under the GPL.  See http://www.apache.org/licenses/GPL-compatibility.html

  for why Apache projects can't link to GPL licensed projects.   
Apache, BSD or MIT style licenses are not a problem.


&gt;
&gt;
&gt; Since I am only planning to develop support for the XMPP/Jabber
&gt; protocol would it make more sense to call the appender, "XMPPAppender"
&gt; or "JabberAppender" instead of IMAppender?
&gt;
&gt; Thanks.
&gt;
&gt; -- 
&gt; George Morgan


Can't write more at the moment.


</pre>
</div>
</content>
</entry>
<entry>
<title>New appender for log4cxx</title>
<author><name>George Morgan &lt;gm.vtee@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200906.mbox/%3c550236570906080905v2482f845t7e843d5f00327de3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c550236570906080905v2482f845t7e843d5f00327de3@mail-gmail-com%3e</id>
<updated>2009-06-08T16:05:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I've started porting the IMAppender from log4j-sandbox to log4cxx.  I
am hoping to produce code which is suitable for inclusion in the
log4cxx distribution.

Is there is a list of guidelines for inclusion somewhere?

I've looked over the code and was wondering if I should base my new
appender on the AppenderSkeleton or the SocketAppenderSkeleton?

I'm planning to use libstrophe for the XMPP interface and was
wondering what I need to ask the author of that library in order to
not preclude inclusion of my code in log4cxx?

Since I am only planning to develop support for the XMPP/Jabber
protocol would it make more sense to call the appender, "XMPPAppender"
or "JabberAppender" instead of IMAppender?

Thanks.

-- 
George Morgan


</pre>
</div>
</content>
</entry>
<entry>
<title>Log4cxx output redirect to stderr (linux)</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c5d5d09c0905300532q41eb1ecai9510c938796f5fc2@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0905300532q41eb1ecai9510c938796f5fc2@mail-gmail-com%3e</id>
<updated>2009-05-30T12:32:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
  Do we have any config option in log4cxx to redirect log4cxx output to
stderr on linux?
Thanks
Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>How to print there ID in decimal</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c5d5d09c0905272101v1bfd3e5dw665f93be42795598@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0905272101v1bfd3e5dw665f93be42795598@mail-gmail-com%3e</id>
<updated>2009-05-28T04:01:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am using following pattern layout, Using [%-5t] to print the
thread name which prints  in hexadecimal.
Is there any way to print thread ID in decimal.

log4cxx::PatternLayout("%c-%p (%d{dd MMM yyyy HH:mm}) [%-5t] %m%n")

Thanks
Deepak


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Issue with PropertyConfigurator::configure function</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c5d5d09c0905250741p193d6e0elb09b481ad3acae79@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0905250741p193d6e0elb09b481ad3acae79@mail-gmail-com%3e</id>
<updated>2009-05-25T14:41:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
hi Curt,
  Thanks for the mail.
  In My code, I wanted to check for incorrect configuration file.
  Is there any way to know that if
log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
does not succeed. (apart form getting error message to the cosole). Doe it
provide anything which we can handle programatically if function returns
error?
  -------------------Code-----------------
void InitLog(const char *file)
{
    log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
 }
----------




On Mon, May 25, 2009 at 6:50 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:

&gt; log4cxx follows the pattern set by log4j which is to silently swallow any
&gt; configuration errors.  Add a log4j.debug=true to your property file and you
&gt; may get some diagnostic output to the console.  Otherwise, post your
&gt; configuration file here and we can help.
&gt;
&gt;
&gt;
&gt; On May 24, 2009, at 3:14 PM, deepak singh wrote:
&gt;
&gt; Hi,
&gt;&gt;  I am using property file to configure the log4cxx. I am not able to check
&gt;&gt; the correctness of the input property file.
&gt;&gt;  I tried the try, catch but PropertyConfigurator::configure function is
&gt;&gt; not throwing any exception.
&gt;&gt;  I passed the dummy property file and in this case configure file printing
&gt;&gt; following messages on the console :
&gt;&gt;
&gt;&gt; log4cxx: No appender could be found for logger (root).
&gt;&gt;  log4cxx: Please initialize the log4cxx system properly.
&gt;&gt;
&gt;&gt;
&gt;&gt;  Please let me know how to catch this error?
&gt;&gt; -------------------Code-----------------
&gt;&gt; void InitLog(const char *file)
&gt;&gt; {
&gt;&gt;     log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
&gt;&gt;  }
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Issue with PropertyConfigurator::configure function</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c895033B9-DF91-4266-9237-037318B97663@apache.org%3e"/>
<id>urn:uuid:%3c895033B9-DF91-4266-9237-037318B97663@apache-org%3e</id>
<updated>2009-05-25T13:20:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
log4cxx follows the pattern set by log4j which is to silently swallow  
any configuration errors.  Add a log4j.debug=true to your property  
file and you may get some diagnostic output to the console.   
Otherwise, post your configuration file here and we can help.


On May 24, 2009, at 3:14 PM, deepak singh wrote:

&gt; Hi,
&gt;  I am using property file to configure the log4cxx. I am not able to  
&gt; check the correctness of the input property file.
&gt;  I tried the try, catch but PropertyConfigurator::configure function  
&gt; is not throwing any exception.
&gt;  I passed the dummy property file and in this case configure file  
&gt; printing following messages on the console :
&gt;
&gt; log4cxx: No appender could be found for logger (root).
&gt;  log4cxx: Please initialize the log4cxx system properly.
&gt;
&gt;
&gt;  Please let me know how to catch this error?
&gt; -------------------Code-----------------
&gt; void InitLog(const char *file)
&gt; {
&gt;      log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
&gt;  }



</pre>
</div>
</content>
</entry>
<entry>
<title>Issue with PropertyConfigurator::configure function</title>
<author><name>deepak singh &lt;deepak.iitg@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c5d5d09c0905241314l41352ccasb745cda25e1d45e0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0905241314l41352ccasb745cda25e1d45e0@mail-gmail-com%3e</id>
<updated>2009-05-24T20:14:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
 I am using property file to configure the log4cxx. I am not able to check
the correctness of the input property file.
 I tried the try, catch but PropertyConfigurator::configure function is not
throwing any exception.
 I passed the dummy property file and in this case configure file printing
following messages on the console :

log4cxx: No appender could be found for logger (root).
 log4cxx: Please initialize the log4cxx system properly.


 Please let me know how to catch this error?
-------------------Code-----------------
void InitLog(const char *file)
{
     log4cxx::PropertyConfigurator::configure(log4cxx::File(file));
 }


</pre>
</div>
</content>
</entry>
<entry>
<title>Compiling with sunstudio 11</title>
<author><name>&quot;CREMARENCO Cosmin&quot; &lt;Cosmin.CREMARENCO@murex.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200905.mbox/%3c04F727D3C92D7B4F9260CD0E5C19601020A90A@CHICO.murex.com%3e"/>
<id>urn:uuid:%3c04F727D3C92D7B4F9260CD0E5C19601020A90A@CHICO-murex-com%3e</id>
<updated>2009-05-19T10:21:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

I've been running into some issues when compiling log4cxx.
Mostly standard library functions that aren't declared before they are
used.
I attached a patch that fixes the problems I found.

CXX=/nettools/sunstudio/sunstudio11/SUNWspro/bin/CC
CC=/nettools/sunstudio/sunstudio11/SUNWspro/bin/cc ./configure
--with-apr=/src/work/mw/log4cxx-sunstudio11/apr-1.3.3
--with-apr-util=/src/work/mw/log4cxx-sunstudio/apr-util-1.3.4
--prefix=/src/work/mw/log4cxx-sunstudio11/log4cxx-build
CXXFLAGS="-library=stlport4"

bash$ CC -V
CC: Sun C++ 5.8 Patch 121018-11 2007/05/02

bash$ uname -a
SunOS pegasus 5.10 Generic_118855-33 i86pc i386 i86pc


Best regards,

Cosmin


</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r768863 - /logging/log4cxx/trunk/src/examples/cpp/console.cpp</title>
<author><name>carnold@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c20090427035352.816B423889C0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20090427035352-816B423889C0@eris-apache-org%3e</id>
<updated>2009-04-27T03:53:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: carnold
Date: Mon Apr 27 03:53:50 2009
New Revision: 768863

URL: http://svn.apache.org/viewvc?rev=768863&amp;view=rev
Log:
LOGCXX-332: fails to build with gcc 4.4

Modified:
    logging/log4cxx/trunk/src/examples/cpp/console.cpp

Modified: logging/log4cxx/trunk/src/examples/cpp/console.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/examples/cpp/console.cpp?rev=768863&amp;r1=768862&amp;r2=768863&amp;view=diff
==============================================================================
--- logging/log4cxx/trunk/src/examples/cpp/console.cpp (original)
+++ logging/log4cxx/trunk/src/examples/cpp/console.cpp Mon Apr 27 03:53:50 2009
@@ -23,6 +23,8 @@
 #include &lt;iostream&gt;
 #include &lt;locale.h&gt;
 #include &lt;cstring&gt;
+#include &lt;cstdio&gt;
+#include &lt;stdint.h&gt;
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904121840q23cee528h5972d9f677567d2a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904121840q23cee528h5972d9f677567d2a@mail-gmail-com%3e</id>
<updated>2009-04-13T01:40:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Curt,  problem solved.

On Thu, Apr 9, 2009 at 8:33 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:

&gt;
&gt; On Apr 9, 2009, at 4:17 AM, Lijuan Zhu wrote:
&gt;
&gt;  More debugging showed where the error was:
&gt;&gt;
&gt;&gt; In the misc.c around line 161
&gt;&gt;
&gt;&gt; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal)
&gt;&gt; {
&gt;&gt;    if (!lateDllHandle[fnLib]) {
&gt;&gt;        lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
&gt;&gt;        if (!lateDllHandle[fnLib])
&gt;&gt;            return NULL;
&gt;&gt;    }
&gt;&gt;    if (ordinal)
&gt;&gt;        return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
&gt;&gt;    else
&gt;&gt;        return GetProcAddress(lateDllHandle[fnLib], fnName);
&gt;&gt; }
&gt;&gt;
&gt;&gt; The LoadLibrary("kernel32") returned NULL, which caused the problem.
&gt;&gt;
&gt;&gt; The error code is 126, can not find the module kernel32 ? why it can not
&gt;&gt; find the kernel32.dll, it is in the c:\windows\system32 ...
&gt;&gt;
&gt;&gt; Anyone can help me out?
&gt;&gt;
&gt;&gt; Thanks,
&gt;&gt; Lijuan
&gt;&gt;
&gt;&gt;
&gt; Looks like an APR issue, try searching the APR mailing list and bugzilla (
&gt; http://apr.apache.org) before asking on user@apr.apache.org.  If you ask
&gt; there, specify the precise version of Windows you are using, what value of
&gt; the arguments to apr_stat and the expected and actual results.  More likely
&gt; to get a quicker response there.
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3cC3A71B9D-4E17-4212-AEA6-F8AF6FCB8DE0@apache.org%3e"/>
<id>urn:uuid:%3cC3A71B9D-4E17-4212-AEA6-F8AF6FCB8DE0@apache-org%3e</id>
<updated>2009-04-09T12:33:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Apr 9, 2009, at 4:17 AM, Lijuan Zhu wrote:

&gt; More debugging showed where the error was:
&gt;
&gt; In the misc.c around line 161
&gt;
&gt; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int  
&gt; ordinal)
&gt; {
&gt;     if (!lateDllHandle[fnLib]) {
&gt;         lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
&gt;         if (!lateDllHandle[fnLib])
&gt;             return NULL;
&gt;     }
&gt;     if (ordinal)
&gt;         return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
&gt;     else
&gt;         return GetProcAddress(lateDllHandle[fnLib], fnName);
&gt; }
&gt;
&gt; The LoadLibrary("kernel32") returned NULL, which caused the problem.
&gt;
&gt; The error code is 126, can not find the module kernel32 ? why it can  
&gt; not find the kernel32.dll, it is in the c:\windows\system32 ...
&gt;
&gt; Anyone can help me out?
&gt;
&gt; Thanks,
&gt; Lijuan
&gt;

Looks like an APR issue, try searching the APR mailing list and  
bugzilla (http://apr.apache.org) before asking on  
user@apr.apache.org.  If you ask there, specify the precise version of  
Windows you are using, what value of the arguments to apr_stat and the  
expected and actual results.  More likely to get a quicker response  
there.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904090217r51c83fffufa3ccf79725f954@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904090217r51c83fffufa3ccf79725f954@mail-gmail-com%3e</id>
<updated>2009-04-09T09:17:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
More debugging showed where the error was:

In the misc.c around line 161

FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal)
{
    if (!lateDllHandle[fnLib]) {
        lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
        if (!lateDllHandle[fnLib])
            return NULL;
    }
    if (ordinal)
        return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
    else
        return GetProcAddress(lateDllHandle[fnLib], fnName);
}

The LoadLibrary("kernel32") returned NULL, which caused the problem.

The error code is 126, can not find the module kernel32 ? why it can not
find the kernel32.dll, it is in the c:\windows\system32 ...

Anyone can help me out?

Thanks,
Lijuan



On Thu, Apr 9, 2009 at 12:23 PM, Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt; wrote:

&gt;
&gt;
&gt; On Thu, Apr 9, 2009 at 12:03 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:
&gt;
&gt;&gt; Try using forward slashes in the file name.  If that doesn't work, start
&gt;&gt; with a file no directory specification.  log4cxx uses APR which provides a
&gt;&gt; consistent API above the filesystem including trying to provide a consistent
&gt;&gt; file specification format (as does Java) and takes forward slashes on all
&gt;&gt; platforms.
&gt;&gt;
&gt;&gt; If you are using the property configuration, backslashes are escape
&gt;&gt; sequences and will get mangled (double backslashes should work fine).
&gt;&gt;  Wouldn't think it would affect you if you were using XML configuration.
&gt;&gt;
&gt;&gt; The file open is in src/fileoutputstream.cpp around line 54.
&gt;
&gt;
&gt; I tried to debug into it, but did not hit the breakpoint into
&gt; src/fileoutputstream.cpp
&gt;
&gt; This is my call stack:  (failed in GetFileAttributesExW, because the file
&gt; does not exist ...)
&gt;
&gt; &gt;    pslog.dll!apr_winapi_GetFileAttributesExW(const unsigned short *
&gt; lpFileName=0x001286e8, _GET_FILEEX_INFO_LEVELS
&gt; fInfoLevelId=GetFileExInfoStandard, void * lpFileInformation=0x00128494)
&gt; Line 204 + 0x3a bytes    C
&gt;      pslog.dll!apr_stat(apr_finfo_t * finfo=0x0012c760, const char *
&gt; fname=0x0188c500, int wanted=256, apr_pool_t * pool=0x0188c040)  Line 496 +
&gt; 0x15 bytes    C
&gt;      pslog.dll!log4cxx::File::length(log4cxx::helpers::Pool &amp; pool={...})
&gt; Line 171 + 0x24 bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::rolling::RollingFileAppenderSkeleton::activateOptions(log4cxx::helpers::Pool
&gt; &amp; p={...})  Line 106 + 0xc bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::RollingFileAppender::activateOptions(log4cxx::helpers::Pool
&gt; &amp; pool={...})  Line 153    C++
&gt;
&gt;  pslog.dll!log4cxx::config::PropertySetter::activate(log4cxx::helpers::Pool
&gt; &amp; p={...})  Line 102 + 0x37 bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::parseAppender(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * appenderElement=0x01891a40, apr_xml_doc *
&gt; doc=0x01891100,
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 264    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * element=0x01891a40, apr_xml_doc *
&gt; doc=0x01891100, const
&gt; std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; &amp; appenderName="MyRollingAppenderSize",
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 131 + 0x23 bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
&gt; doc=0x01891100, const
&gt; std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; &amp; appenderName="MyRollingAppenderSize",
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 135 + 0x2a bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByReference(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * appenderRef=0x0188c438, apr_xml_doc *
&gt; doc=0x01891100,
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 159 + 0x29 bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::parseChildrenOfLoggerElement(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * loggerElement=0x0188c330,
&gt; log4cxx::helpers::ObjectPtrT&lt;log4cxx::Logger&gt; logger={...}, bool
&gt; isRoot=true, apr_xml_doc * doc=0x01891100,
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 463 + 0x20 bytes    C++
&gt;
&gt;  pslog.dll!log4cxx::xml::DOMConfigurator::parseRoot(log4cxx::helpers::Pool &amp;
&gt; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * rootElement=0x0188c330, apr_xml_doc *
&gt; doc=0x01891100,
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 436    C++
&gt;      pslog.dll!log4cxx::xml::DOMConfigurator::parse(log4cxx::helpers::Pool
&gt; &amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
&gt; utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
&gt; doc=0x01891100,
&gt; std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt;
&gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
&gt; appenders=[0]())  Line 938    C++
&gt;      pslog.dll!log4cxx::xml::DOMConfigurator::doConfigure(const
&gt; log4cxx::File &amp; filename={...},
&gt; log4cxx::helpers::ObjectPtrT&lt;log4cxx::spi::LoggerRepository&gt; &amp;
&gt; repository1={...})  Line 742    C++
&gt;      pslog.dll!log4cxx::xml::DOMConfigurator::configure(const
&gt; std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &gt; &amp; filename="d:\SVN\projectwise\ncpe\bin\tf.log.xml")  Line 756 + 0x64
&gt; bytes    C++
&gt;
&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:
&gt;&gt;
&gt;&gt;  I am new to log4cxx, and just got it set up into my application. I
&gt;&gt;&gt; configured a xml file for the logging, but the log file like c:\temp.log
&gt;&gt;&gt; could not be created by the log4cxx. I am sure my app has the privelegesto
&gt;&gt;&gt; create file.
&gt;&gt;&gt; I would like to debug the source code, would someone please point me to
&gt;&gt;&gt; the source code?
&gt;&gt;&gt;
&gt;&gt;&gt; Thanks,
&gt;&gt;&gt; Lijuan
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904082123q72bdd07evd6e0675fe5a276b8@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904082123q72bdd07evd6e0675fe5a276b8@mail-gmail-com%3e</id>
<updated>2009-04-09T04:23:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Thu, Apr 9, 2009 at 12:03 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:

&gt; Try using forward slashes in the file name.  If that doesn't work, start
&gt; with a file no directory specification.  log4cxx uses APR which provides a
&gt; consistent API above the filesystem including trying to provide a consistent
&gt; file specification format (as does Java) and takes forward slashes on all
&gt; platforms.
&gt;
&gt; If you are using the property configuration, backslashes are escape
&gt; sequences and will get mangled (double backslashes should work fine).
&gt;  Wouldn't think it would affect you if you were using XML configuration.
&gt;
&gt; The file open is in src/fileoutputstream.cpp around line 54.


I tried to debug into it, but did not hit the breakpoint into
src/fileoutputstream.cpp

This is my call stack:  (failed in GetFileAttributesExW, because the file
does not exist ...)

&gt;    pslog.dll!apr_winapi_GetFileAttributesExW(const unsigned short *
lpFileName=0x001286e8, _GET_FILEEX_INFO_LEVELS
fInfoLevelId=GetFileExInfoStandard, void * lpFileInformation=0x00128494)
Line 204 + 0x3a bytes    C
     pslog.dll!apr_stat(apr_finfo_t * finfo=0x0012c760, const char *
fname=0x0188c500, int wanted=256, apr_pool_t * pool=0x0188c040)  Line 496 +
0x15 bytes    C
     pslog.dll!log4cxx::File::length(log4cxx::helpers::Pool &amp; pool={...})
Line 171 + 0x24 bytes    C++

 pslog.dll!log4cxx::rolling::RollingFileAppenderSkeleton::activateOptions(log4cxx::helpers::Pool
&amp; p={...})  Line 106 + 0xc bytes    C++

 pslog.dll!log4cxx::RollingFileAppender::activateOptions(log4cxx::helpers::Pool
&amp; pool={...})  Line 153    C++

 pslog.dll!log4cxx::config::PropertySetter::activate(log4cxx::helpers::Pool
&amp; p={...})  Line 102 + 0x37 bytes    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::parseAppender(log4cxx::helpers::Pool
&amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * appenderElement=0x01891a40, apr_xml_doc *
doc=0x01891100,
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 264    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
&amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * element=0x01891a40, apr_xml_doc *
doc=0x01891100, const
std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &amp; appenderName="MyRollingAppenderSize",
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 131 + 0x23 bytes    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
&amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
doc=0x01891100, const
std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &amp; appenderName="MyRollingAppenderSize",
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 135 + 0x2a bytes    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByReference(log4cxx::helpers::Pool
&amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * appenderRef=0x0188c438, apr_xml_doc *
doc=0x01891100,
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 159 + 0x29 bytes    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::parseChildrenOfLoggerElement(log4cxx::helpers::Pool
&amp; p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * loggerElement=0x0188c330,
log4cxx::helpers::ObjectPtrT&lt;log4cxx::Logger&gt; logger={...}, bool
isRoot=true, apr_xml_doc * doc=0x01891100,
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 463 + 0x20 bytes    C++

 pslog.dll!log4cxx::xml::DOMConfigurator::parseRoot(log4cxx::helpers::Pool &amp;
p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * rootElement=0x0188c330, apr_xml_doc *
doc=0x01891100,
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 436    C++
     pslog.dll!log4cxx::xml::DOMConfigurator::parse(log4cxx::helpers::Pool &amp;
p={...}, log4cxx::helpers::ObjectPtrT&lt;log4cxx::helpers::CharsetDecoder&gt; &amp;
utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
doc=0x01891100,
std::map&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt;,std::less&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt;
&gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; const ,log4cxx::helpers::ObjectPtrT&lt;log4cxx::Appender&gt; &gt; &gt; &gt; &amp;
appenders=[0]())  Line 938    C++
     pslog.dll!log4cxx::xml::DOMConfigurator::doConfigure(const
log4cxx::File &amp; filename={...},
log4cxx::helpers::ObjectPtrT&lt;log4cxx::spi::LoggerRepository&gt; &amp;
repository1={...})  Line 742    C++
     pslog.dll!log4cxx::xml::DOMConfigurator::configure(const
std::basic_string&lt;wchar_t,std::char_traits&lt;wchar_t&gt;,std::allocator&lt;wchar_t&gt;
&gt; &amp; filename="d:\SVN\projectwise\ncpe\bin\tf.log.xml")  Line 756 + 0x64
bytes    C++


&gt;
&gt;
&gt;
&gt; On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:
&gt;
&gt;  I am new to log4cxx, and just got it set up into my application. I
&gt;&gt; configured a xml file for the logging, but the log file like c:\temp.log
&gt;&gt; could not be created by the log4cxx. I am sure my app has the privelegesto
&gt;&gt; create file.
&gt;&gt; I would like to debug the source code, would someone please point me to
&gt;&gt; the source code?
&gt;&gt;
&gt;&gt; Thanks,
&gt;&gt; Lijuan
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904082113v30193d23m47d3b23b9988dbc4@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904082113v30193d23m47d3b23b9988dbc4@mail-gmail-com%3e</id>
<updated>2009-04-09T04:13:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
sorry, I was wrong. If I don't specify any directory, the log file was
created, and log worked fine.

But I retried the forward slashes, did not work ...

On Thu, Apr 9, 2009 at 12:07 PM, Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt; wrote:

&gt; Curt, thanks again!
&gt;
&gt; I am using the xml configuration file, and tried forward slashes, no
&gt; directory before I asking the question, still no luck...
&gt;
&gt; On Thu, Apr 9, 2009 at 12:03 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:
&gt;
&gt;&gt; Try using forward slashes in the file name.  If that doesn't work, start
&gt;&gt; with a file no directory specification.  log4cxx uses APR which provides a
&gt;&gt; consistent API above the filesystem including trying to provide a consistent
&gt;&gt; file specification format (as does Java) and takes forward slashes on all
&gt;&gt; platforms.
&gt;&gt;
&gt;&gt; If you are using the property configuration, backslashes are escape
&gt;&gt; sequences and will get mangled (double backslashes should work fine).
&gt;&gt;  Wouldn't think it would affect you if you were using XML configuration.
&gt;&gt;
&gt;&gt; The file open is in src/fileoutputstream.cpp around line 54.
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:
&gt;&gt;
&gt;&gt;  I am new to log4cxx, and just got it set up into my application. I
&gt;&gt;&gt; configured a xml file for the logging, but the log file like c:\temp.log
&gt;&gt;&gt; could not be created by the log4cxx. I am sure my app has the privelegesto
&gt;&gt;&gt; create file.
&gt;&gt;&gt; I would like to debug the source code, would someone please point me to
&gt;&gt;&gt; the source code?
&gt;&gt;&gt;
&gt;&gt;&gt; Thanks,
&gt;&gt;&gt; Lijuan
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904082107o1bd3ce48h9de4face2dc845e5@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904082107o1bd3ce48h9de4face2dc845e5@mail-gmail-com%3e</id>
<updated>2009-04-09T04:07:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Curt, thanks again!

I am using the xml configuration file, and tried forward slashes, no
directory before I asking the question, still no luck...

On Thu, Apr 9, 2009 at 12:03 PM, Curt Arnold &lt;carnold@apache.org&gt; wrote:

&gt; Try using forward slashes in the file name.  If that doesn't work, start
&gt; with a file no directory specification.  log4cxx uses APR which provides a
&gt; consistent API above the filesystem including trying to provide a consistent
&gt; file specification format (as does Java) and takes forward slashes on all
&gt; platforms.
&gt;
&gt; If you are using the property configuration, backslashes are escape
&gt; sequences and will get mangled (double backslashes should work fine).
&gt;  Wouldn't think it would affect you if you were using XML configuration.
&gt;
&gt; The file open is in src/fileoutputstream.cpp around line 54.
&gt;
&gt;
&gt;
&gt; On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:
&gt;
&gt;  I am new to log4cxx, and just got it set up into my application. I
&gt;&gt; configured a xml file for the logging, but the log file like c:\temp.log
&gt;&gt; could not be created by the log4cxx. I am sure my app has the privelegesto
&gt;&gt; create file.
&gt;&gt; I would like to debug the source code, would someone please point me to
&gt;&gt; the source code?
&gt;&gt;
&gt;&gt; Thanks,
&gt;&gt; Lijuan
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Where is the source code attempting to create the log file?</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3cD4C40E5D-A128-40E7-BEBD-4E11B325B684@apache.org%3e"/>
<id>urn:uuid:%3cD4C40E5D-A128-40E7-BEBD-4E11B325B684@apache-org%3e</id>
<updated>2009-04-09T04:03:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Try using forward slashes in the file name.  If that doesn't work,  
start with a file no directory specification.  log4cxx uses APR which  
provides a consistent API above the filesystem including trying to  
provide a consistent file specification format (as does Java) and  
takes forward slashes on all platforms.

If you are using the property configuration, backslashes are escape  
sequences and will get mangled (double backslashes should work fine).   
Wouldn't think it would affect you if you were using XML configuration.

The file open is in src/fileoutputstream.cpp around line 54.


On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:

&gt; I am new to log4cxx, and just got it set up into my application. I  
&gt; configured a xml file for the logging, but the log file like c: 
&gt; \temp.log could not be created by the log4cxx. I am sure my app has  
&gt; the privelegesto create file.
&gt; I would like to debug the source code, would someone please point me  
&gt; to the source code?
&gt;
&gt; Thanks,
&gt; Lijuan



</pre>
</div>
</content>
</entry>
<entry>
<title>Where is the source code attempting to create the log file?</title>
<author><name>Lijuan Zhu &lt;zhu.lijuan@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200904.mbox/%3c6f94e56d0904082030h4ea5228ao1bdabc0f87f7a46c@mail.gmail.com%3e"/>
<id>urn:uuid:%3c6f94e56d0904082030h4ea5228ao1bdabc0f87f7a46c@mail-gmail-com%3e</id>
<updated>2009-04-09T03:30:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am new to log4cxx, and just got it set up into my application. I
configured a xml file for the logging, but the log file like c:\temp.log
could not be created by the log4cxx. I am sure my app has the privelegesto
create file.
I would like to debug the source code, would someone please point me to the
source code?

Thanks,
Lijuan


</pre>
</div>
</content>
</entry>
<entry>
<title>Exception from Log4cxx on full filesystem</title>
<author><name>aman &lt;amansinghatwal@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c2485ff000901210507u5b18b91cq1ddd58b8e6b1ffcd@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2485ff000901210507u5b18b91cq1ddd58b8e6b1ffcd@mail-gmail-com%3e</id>
<updated>2009-01-21T13:07:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi All

Facing some trouble because of Log4cxx when the Filesystem is full ...
Seems like whenever the Filesystem is full log4cxx throws an IOException ...

I am using RollingFileAppender under unix enviornment ...

What I essentially want is for the logger to stop logging as soon as the
filesystem is full ... although I achieved this by putting simple try/catch
blocks around log4cxx wrappers in my code ... but this drastically
degraded my applications performance ... and I am unable to figure out the
reason ... however application regains normality when some space is freed up
from filesystem ....

Tried the same stuff using log4j and turns out ...that it doesn't throw any
exception to the application when out of disk space(why cant log4cxx do that
???) ....

Can anyone please suggest an alternate approach or workaround ... as i don't
want to handle this exception at my application level ...

Any suggestions will be valuable and greatly appreciated


</pre>
</div>
</content>
</entry>
<entry>
<title>[Fwd: Build problems on libc6 2.8]</title>
<author><name>=?UTF-8?B?0JLQuNC60YLQvtGAINCa0LDQt9Cw0LrQvtCy?= &lt;kvs16@yandex.ru&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c49759C37.70001@yandex.ru%3e"/>
<id>urn:uuid:%3c49759C37-70001@yandex-ru%3e</id>
<updated>2009-01-20T09:41:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Resending because didn't get an answer. Seem like folks were on holidays...

------------------------------------------------------------------------------------------------

Hello, guys!

Seems like log4cxx 0.10.0 doesn't build with libc6 2.8 and g++ 4.3.2 
under Ubuntu 8.10.

Functions memmove(), memcpy(), and strcmp() don't resolve.

The problems are in files:

./src/main/cpp/inputstreamreader.cpp
./src/main/cpp/socketoutputstream.cpp
./src/examples/cpp/console.cpp


Adding #include &lt;string.h&gt; to the above files fixes the problem. I made 
a patch but maybe you have some abstraction over standard libc6 headers. 
So tell me what to do. Should I submit this stuff somewhere?

Viktor Kazakov

P.S. This latest version of libc6 brought pain to many builds I guess...




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Crashes on exit() from multithreaded program using log4cxx</title>
<author><name>&quot;rhosyn@purplescarab.com&quot; &lt;rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c4975157F.8070001@purplescarab.com%3e"/>
<id>urn:uuid:%3c4975157F-8070001@purplescarab-com%3e</id>
<updated>2009-01-20T00:06:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


Curt Arnold wrote:
&gt;
&gt; On Jan 16, 2009, at 9:34 AM, Rhosyn wrote:
&gt;
&gt;&gt; Dear all,
&gt;&gt;
&gt;&gt;
&gt;&gt; The crashes
&gt;&gt; ===========
&gt;&gt;
&gt;&gt; We would like to share with you some patches to log4cxx  we have found
&gt;&gt; useful in our environment.
&gt;&gt;
&gt;&gt; Our product  (a Linux platform server product, compiled with g++ 4.3.x)
&gt;&gt; started suffering from crashes during (what should have been) graceful
&gt;&gt; process exit ("exit(0);")- after we replaced our old logging framework
&gt;&gt; with a log4cxx backend.
&gt;&gt;
&gt;&gt; Commonly we would see segmentation faults in:
&gt;&gt;
&gt;&gt; * log4cxx::helpers::ObjectPtrBase()
&gt;&gt; * log4cxx::LogManager::getLoggerLS()
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; The cause
&gt;&gt; =========
&gt;&gt;
&gt;&gt; We eventually traced this issue to the pervasive pattern of (mis)usage
&gt;&gt; of singletons in the log4cxx code.
&gt;&gt;
&gt;&gt; The log4cxx library uses the "Meyers" singleton pattern, first
&gt;&gt; popularised in Scott Meyers "Effective C++" (Item 47 in the 2nd edition
&gt;&gt; of that book):
&gt;&gt;
&gt;&gt; Thing &amp; getThingSingleton()
&gt;&gt; {
&gt;&gt;    static Thing t;
&gt;&gt;    return t;
&gt;&gt; }
&gt;&gt;
&gt;&gt;
&gt;&gt; For many years, the above pattern was considered "best practice" for
&gt;&gt; using Singletons in C++ - and was generally safe for most popular
&gt;&gt; compiler implementations and most applications.
&gt;&gt;
&gt;&gt; Unfortunately, this recommendation is not actually guaranteed to be
&gt;&gt; thread-safe for construction or destruction - something which is alluded
&gt;&gt; to on Scott Meyers' own "Errata List for Effective C++, Second Edition"
&gt;&gt; as described here: http://www.aristeia.com/BookErrata/ec++2e-errata.html
&gt;&gt;
&gt;&gt;
&gt;&gt; The nub of the problem is that when a process calls "exit(0);" or
&gt;&gt; similar, one thread will start running, in order, any user-registered
&gt;&gt; "atexit" functions.
&gt;&gt;
&gt;&gt; Along with these, the compiler will execute the (conceptually similar)
&gt;&gt; compiler-registered functions which invoke the destructors of any static
&gt;&gt; file or function scope objects (also in order - the reverse order to
&gt;&gt; static object construction).
&gt;&gt;
&gt;&gt; Unfortunately, other threads may still be in the process of running -and
&gt;&gt; logging, perhaps using the static objects - during or after the
&gt;&gt; execution of their destructors - thus opening the door to a bunch of
&gt;&gt; potential SEGFAULTs.
&gt;&gt;
&gt;&gt;
&gt;&gt; Solutions
&gt;&gt; =========
&gt;&gt;
&gt;&gt; Andrei Alexandrescu goes into a lot of detail about this C++ design
&gt;&gt; problem in chapter 6 of "Modern C++ design" and proposes two elegant
&gt;&gt; solutions -  a "Phoenix Singleton" or  SingletonHolder class.
&gt;&gt;
&gt;&gt; The patches attached are somewhat less elegant than either of
&gt;&gt; Alexandrescus suggestions (we were pressed for time and needed a quick
&gt;&gt; fix in order to ship on time).
&gt;&gt;
&gt;&gt; However, the patches supplied are simple, pragmatic - and did appear to
&gt;&gt; hold up during our testing (testing which was readily producing the
&gt;&gt; crashes described earlier, before we patched).
&gt;&gt;
&gt;&gt; In summary, the patches change Singleton functions to work thus:
&gt;&gt;
&gt;&gt; Thing &amp; getThingSingleton()
&gt;&gt; {
&gt;&gt;    static Thing * t = new t;
&gt;&gt;    return *t;
&gt;&gt; }
&gt;&gt;
&gt;&gt; Of course, the downside of this flavour of fix is that:
&gt;&gt;
&gt;&gt; * the static objects - now allocated on the heap with new() - never get
&gt;&gt; their destructors run.  AFAIK, no other resources (other than memory)
&gt;&gt; appear to be leaked (due to this patch).  Fortunately, as we are running
&gt;&gt; on a modern OS, we are able to rely on the OS to reclaim the process
&gt;&gt; memory on process exit - thus nullifying this particular issue for our
&gt;&gt; product (but not neccessarily so in other environments).
&gt;&gt;
&gt;&gt; * The patch doesn't address the startup/initialisation race  (for that
&gt;&gt; we'd need a multiple-locked singleton initialization pattern everywhere
&gt;&gt; log4cxx creates a singleton) - we're less worried about that at this
&gt;&gt; stage as we have yet to notice any issues.
&gt;&gt;
&gt;&gt; apr
&gt;&gt; ===
&gt;&gt;
&gt;&gt; Finally we couldn't work out how it could ever be safe to deiinitialise
&gt;&gt; APR if there was even the slightest chance that any extant log4cxx
&gt;&gt; objects existed (accessible to any thread).  We therefore removed the
&gt;&gt; apr_terminate() call in APRInitializer::~APRInitializer()
&gt;&gt;
&gt;&gt;
&gt;&gt; Future
&gt;&gt; ======
&gt;&gt;
&gt;&gt; I would like to respecfully suggest that there is a discussion in the
&gt;&gt; log4cxx community about  the best way of reworking the use of singletons
&gt;&gt; in the log4cxx library  (multithreaded-safe construction and
&gt;&gt; destruction)  - and that we look to moving towards a different pattern
&gt;&gt; of usage.
&gt;&gt;
&gt;&gt; I suspect Alexandrescu's "singleton holder" idea might form a part of a
&gt;&gt; possible solution - but it's not the only game in town.
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;
&gt; Thanks for the analysis.
&gt;
&gt; There is a bit of tension here since those who are running under 
&gt; BoundsChecker, Valgrind, Purify et al will then complain about leaks.  
&gt; Probably the best approach is to try to isolate the singleton pattern 
&gt; into a preprocessor macro and then allow the user to select what 
&gt; singleton pattern they'd like to use.
&gt;
&gt; Please file this as a bug report at http://issues.apache.org/jira
&gt;


Thanks; JIRA issue LOGCXX-322 raised, as requested. 


I totally see your point re: BoundsChecker, Valgrind etc. and also re: 
isolating the behaviour.

A more sophisticated patch than my first cut is definitely the order of 
the day!




</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: exception on logging long message to syslog</title>
<author><name>&quot;rhosyn@purplescarab.com&quot; &lt;rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c497513FB.5090709@purplescarab.com%3e"/>
<id>urn:uuid:%3c497513FB-5090709@purplescarab-com%3e</id>
<updated>2009-01-19T23:59:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


Curt Arnold wrote:
&gt;
&gt; On Jan 16, 2009, at 10:45 AM, Rhosyn wrote:
&gt;
&gt;&gt; Dear all,
&gt;&gt;
&gt;&gt; We would like to share with you a patch we use for log4cxx in order to
&gt;&gt; prevent an exception being raised when a very long message is logged.
&gt;&gt;
&gt;&gt; We found our system was sometimes misbehaving due to an exception being
&gt;&gt; raised by log4cxx when a very large message was logged  - but only when
&gt;&gt; the SyslogAppender/SyslogWriter was in use  (other appenders "worked"
&gt;&gt; perfectly).
&gt;&gt;
&gt;&gt; We eventually traced the issue to the message(s) in question being too
&gt;&gt; large to fit inside a UDP packet (the syslog protocol uses UDP).
&gt;&gt;
&gt;&gt; We didn't want to massively restructure our program logic to be able to
&gt;&gt; recover from rare logging errors e.g. by placing message length checking
&gt;&gt; code or exception handling code around every call to every trace
&gt;&gt; function which might ever need to log a long message  (after all,
&gt;&gt; logging, although important &amp; useful, is not the focus of our
&gt;&gt; application - and "massive" log messages are a rarity ).
&gt;&gt;
&gt;&gt; We were particularly certain that this course of action best suited our
&gt;&gt; needs, given that the syslogappender wasn't the only appender in use and
&gt;&gt; the other appenders were capturing the entire message safely.
&gt;&gt;
&gt;&gt; Therefore we felt it pragmatic to instead simply truncate messages that
&gt;&gt; are too long to be sent safely in a UDP packet just prior to sending
&gt;&gt; them.
&gt;&gt;
&gt;&gt; The patch attached does just that - hopefully someone else will find it
&gt;&gt; useful!
&gt;&gt;
&gt;&gt; I would suggest it might be worth rolling a similar patch into any
&gt;&gt; future log4cxx release - although I also accept that that is a
&gt;&gt; philosophical point - and others might actually prefer the current
&gt;&gt; behaviour (although, as discussed previously, it is not behaviour that
&gt;&gt; we can easily/safely live with in our current project)
&gt;&gt;
&gt;&gt; Cheers,
&gt;&gt;
&gt;&gt;
&gt;
&gt; log4j also had similar issues which I assume log4cxx inherited.  See 
&gt; https://issues.apache.org/bugzilla/show_bug.cgi?id=42087
&gt;
&gt; It would likely be good to align log4cxx with the current log4j 
&gt; implementation.  Again, please file a JIRA issue with this and even 
&gt; better if you submit a patch with it.
&gt;
Thanks; JIRA issue LOGCXX-324 raised, as requested. 

I haven't yet submitted a patch as my current attempt is a way off being 
aligned with the log4j implementation.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: patch for compiling objectptr with g++4.1.x with many warnings enabled and warnings as errors</title>
<author><name>&quot;rhosyn@purplescarab.com&quot; &lt;rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c49751371.8050704@purplescarab.com%3e"/>
<id>urn:uuid:%3c49751371-8050704@purplescarab-com%3e</id>
<updated>2009-01-19T23:57:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


Curt Arnold wrote:
&gt;
&gt; On Jan 16, 2009, at 11:53 AM, Rhosyn wrote:
&gt;
&gt;&gt; We found we needed this tiny patch in our environment to compile
&gt;&gt; objectptr with various warnings enabled and warnings-as-errors when
&gt;&gt; using g++ 4.1.x
&gt;&gt;
&gt;&gt; Please find the patch attached - it simply explicitly initialises the
&gt;&gt; base class in the initializer list.
&gt;&gt;
&gt;&gt; Cheers,
&gt;&gt;
&gt;
&gt; Thanks.  Again a JIRA issue would be the preferred.
&gt;

Thanks for the feedback.
JIRA issue LOGCXX-323 raised, as requested.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: patch for compiling objectptr with g++4.1.x with many warnings enabled and warnings as errors</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3cB99687E2-0322-4B6E-A149-96BD543A10E6@apache.org%3e"/>
<id>urn:uuid:%3cB99687E2-0322-4B6E-A149-96BD543A10E6@apache-org%3e</id>
<updated>2009-01-16T20:16:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jan 16, 2009, at 11:53 AM, Rhosyn wrote:

&gt; We found we needed this tiny patch in our environment to compile
&gt; objectptr with various warnings enabled and warnings-as-errors when
&gt; using g++ 4.1.x
&gt;
&gt; Please find the patch attached - it simply explicitly initialises the
&gt; base class in the initializer list.
&gt;
&gt; Cheers,
&gt;

Thanks.  Again a JIRA issue would be the preferred.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in ObjectPtrBase</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c588552EB-8B60-4651-86DA-F9F72FC1072E@apache.org%3e"/>
<id>urn:uuid:%3c588552EB-8B60-4651-86DA-F9F72FC1072E@apache-org%3e</id>
<updated>2009-01-16T20:15:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jan 16, 2009, at 11:47 AM, Rhosyn wrote:

&gt; The attach patch fixes a thread safety issue we found with  
&gt; ObjectPtrBase
&gt; when we ported our application to a 64 bit platform.
&gt;
&gt; It will only work if you are using a version of apr with
&gt; apr_atomic_xchgptr()
&gt;
&gt;
&gt; Cheers
&gt;

apr_atomic_xchgptr was added at our request just for this reason, but  
last I checked it hadn't made it into a released version of APR, but  
likely that has changed.  Would be good to change the configure script  
to detect whether APR has apr_atomic_xchgptr (unless you have a better  
way to detect it) and modify the code to use it if available.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: log4cxx-0.10.0: exception on logging long message to syslog</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3cC47B05EC-FCB4-4BB1-BFD6-6B066D868BFA@apache.org%3e"/>
<id>urn:uuid:%3cC47B05EC-FCB4-4BB1-BFD6-6B066D868BFA@apache-org%3e</id>
<updated>2009-01-16T20:13:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jan 16, 2009, at 10:45 AM, Rhosyn wrote:

&gt; Dear all,
&gt;
&gt; We would like to share with you a patch we use for log4cxx in order to
&gt; prevent an exception being raised when a very long message is logged.
&gt;
&gt; We found our system was sometimes misbehaving due to an exception  
&gt; being
&gt; raised by log4cxx when a very large message was logged  - but only  
&gt; when
&gt; the SyslogAppender/SyslogWriter was in use  (other appenders "worked"
&gt; perfectly).
&gt;
&gt; We eventually traced the issue to the message(s) in question being too
&gt; large to fit inside a UDP packet (the syslog protocol uses UDP).
&gt;
&gt; We didn't want to massively restructure our program logic to be able  
&gt; to
&gt; recover from rare logging errors e.g. by placing message length  
&gt; checking
&gt; code or exception handling code around every call to every trace
&gt; function which might ever need to log a long message  (after all,
&gt; logging, although important &amp; useful, is not the focus of our
&gt; application - and "massive" log messages are a rarity ).
&gt;
&gt; We were particularly certain that this course of action best suited  
&gt; our
&gt; needs, given that the syslogappender wasn't the only appender in use  
&gt; and
&gt; the other appenders were capturing the entire message safely.
&gt;
&gt; Therefore we felt it pragmatic to instead simply truncate messages  
&gt; that
&gt; are too long to be sent safely in a UDP packet just prior to sending
&gt; them.
&gt;
&gt; The patch attached does just that - hopefully someone else will find  
&gt; it
&gt; useful!
&gt;
&gt; I would suggest it might be worth rolling a similar patch into any
&gt; future log4cxx release - although I also accept that that is a
&gt; philosophical point - and others might actually prefer the current
&gt; behaviour (although, as discussed previously, it is not behaviour that
&gt; we can easily/safely live with in our current project)
&gt;
&gt; Cheers,
&gt;
&gt;

log4j also had similar issues which I assume log4cxx inherited.  See https://issues.apache.org/bugzilla/show_bug.cgi?id=42087

It would likely be good to align log4cxx with the current log4j  
implementation.  Again, please file a JIRA issue with this and even  
better if you submit a patch with it.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Crashes on exit() from multithreaded program using log4cxx</title>
<author><name>Curt Arnold &lt;carnold@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3cE10FAB5B-179B-4884-95D8-A55F73B0B319@apache.org%3e"/>
<id>urn:uuid:%3cE10FAB5B-179B-4884-95D8-A55F73B0B319@apache-org%3e</id>
<updated>2009-01-16T20:09:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Jan 16, 2009, at 9:34 AM, Rhosyn wrote:

&gt; Dear all,
&gt;
&gt;
&gt; The crashes
&gt; ===========
&gt;
&gt; We would like to share with you some patches to log4cxx  we have found
&gt; useful in our environment.
&gt;
&gt; Our product  (a Linux platform server product, compiled with g++  
&gt; 4.3.x)
&gt; started suffering from crashes during (what should have been) graceful
&gt; process exit ("exit(0);")- after we replaced our old logging framework
&gt; with a log4cxx backend.
&gt;
&gt; Commonly we would see segmentation faults in:
&gt;
&gt; * log4cxx::helpers::ObjectPtrBase()
&gt; * log4cxx::LogManager::getLoggerLS()
&gt;
&gt;
&gt;
&gt; The cause
&gt; =========
&gt;
&gt; We eventually traced this issue to the pervasive pattern of (mis)usage
&gt; of singletons in the log4cxx code.
&gt;
&gt; The log4cxx library uses the "Meyers" singleton pattern, first
&gt; popularised in Scott Meyers "Effective C++" (Item 47 in the 2nd  
&gt; edition
&gt; of that book):
&gt;
&gt; Thing &amp; getThingSingleton()
&gt; {
&gt;    static Thing t;
&gt;    return t;
&gt; }
&gt;
&gt;
&gt; For many years, the above pattern was considered "best practice" for
&gt; using Singletons in C++ - and was generally safe for most popular
&gt; compiler implementations and most applications.
&gt;
&gt; Unfortunately, this recommendation is not actually guaranteed to be
&gt; thread-safe for construction or destruction - something which is  
&gt; alluded
&gt; to on Scott Meyers' own "Errata List for Effective C++, Second  
&gt; Edition"
&gt; as described here: http://www.aristeia.com/BookErrata/ec++2e-errata.html
&gt;
&gt;
&gt; The nub of the problem is that when a process calls "exit(0);" or
&gt; similar, one thread will start running, in order, any user-registered
&gt; "atexit" functions.
&gt;
&gt; Along with these, the compiler will execute the (conceptually similar)
&gt; compiler-registered functions which invoke the destructors of any  
&gt; static
&gt; file or function scope objects (also in order - the reverse order to
&gt; static object construction).
&gt;
&gt; Unfortunately, other threads may still be in the process of running - 
&gt; and
&gt; logging, perhaps using the static objects - during or after the
&gt; execution of their destructors - thus opening the door to a bunch of
&gt; potential SEGFAULTs.
&gt;
&gt;
&gt; Solutions
&gt; =========
&gt;
&gt; Andrei Alexandrescu goes into a lot of detail about this C++ design
&gt; problem in chapter 6 of "Modern C++ design" and proposes two elegant
&gt; solutions -  a "Phoenix Singleton" or  SingletonHolder class.
&gt;
&gt; The patches attached are somewhat less elegant than either of
&gt; Alexandrescus suggestions (we were pressed for time and needed a quick
&gt; fix in order to ship on time).
&gt;
&gt; However, the patches supplied are simple, pragmatic - and did appear  
&gt; to
&gt; hold up during our testing (testing which was readily producing the
&gt; crashes described earlier, before we patched).
&gt;
&gt; In summary, the patches change Singleton functions to work thus:
&gt;
&gt; Thing &amp; getThingSingleton()
&gt; {
&gt;    static Thing * t = new t;
&gt;    return *t;
&gt; }
&gt;
&gt; Of course, the downside of this flavour of fix is that:
&gt;
&gt; * the static objects - now allocated on the heap with new() - never  
&gt; get
&gt; their destructors run.  AFAIK, no other resources (other than memory)
&gt; appear to be leaked (due to this patch).  Fortunately, as we are  
&gt; running
&gt; on a modern OS, we are able to rely on the OS to reclaim the process
&gt; memory on process exit - thus nullifying this particular issue for our
&gt; product (but not neccessarily so in other environments).
&gt;
&gt; * The patch doesn't address the startup/initialisation race  (for that
&gt; we'd need a multiple-locked singleton initialization pattern  
&gt; everywhere
&gt; log4cxx creates a singleton) - we're less worried about that at this
&gt; stage as we have yet to notice any issues.
&gt;
&gt; apr
&gt; ===
&gt;
&gt; Finally we couldn't work out how it could ever be safe to  
&gt; deiinitialise
&gt; APR if there was even the slightest chance that any extant log4cxx
&gt; objects existed (accessible to any thread).  We therefore removed the
&gt; apr_terminate() call in APRInitializer::~APRInitializer()
&gt;
&gt;
&gt; Future
&gt; ======
&gt;
&gt; I would like to respecfully suggest that there is a discussion in the
&gt; log4cxx community about  the best way of reworking the use of  
&gt; singletons
&gt; in the log4cxx library  (multithreaded-safe construction and
&gt; destruction)  - and that we look to moving towards a different pattern
&gt; of usage.
&gt;
&gt; I suspect Alexandrescu's "singleton holder" idea might form a part  
&gt; of a
&gt; possible solution - but it's not the only game in town.
&gt;
&gt;
&gt;

Thanks for the analysis.

There is a bit of tension here since those who are running under  
BoundsChecker, Valgrind, Purify et al will then complain about leaks.   
Probably the best approach is to try to isolate the singleton pattern  
into a preprocessor macro and then allow the user to select what  
singleton pattern they'd like to use.

Please file this as a bug report at http://issues.apache.org/jira


</pre>
</div>
</content>
</entry>
<entry>
<title>log4cxx-0.10.0 : Fix for infinite loop in Hierarchy::updateParents	in hierarchy.cpp when module name of &quot;.&quot; is used</title>
<author><name>Rhosyn &lt;Rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c1232129059.30824.109.camel@bjhlinux%3e"/>
<id>urn:uuid:%3c1232129059-30824-109-camel@bjhlinux%3e</id>
<updated>2009-01-16T18:04:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The attached patch fixes an infinite loop in log4cxx if a module
hierarchy name of "." was used in certain circumstances/API calls which
ended up in calling Hierarchy::updateParents

Hope this helps someone!

Cheers,



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

</pre>
</div>
</content>
</entry>
<entry>
<title>patch for compiling objectptr with g++4.1.x with many warnings	enabled and warnings as errors</title>
<author><name>Rhosyn &lt;Rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c1232128386.30824.99.camel@bjhlinux%3e"/>
<id>urn:uuid:%3c1232128386-30824-99-camel@bjhlinux%3e</id>
<updated>2009-01-16T17:53:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
We found we needed this tiny patch in our environment to compile
objectptr with various warnings enabled and warnings-as-errors when
using g++ 4.1.x

Please find the patch attached - it simply explicitly initialises the
base class in the initializer list.

Cheers,






______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


</pre>
</div>
</content>
</entry>
<entry>
<title>log4cxx-0.10.0: Fix for 64 bit-only thread safety bug in	ObjectPtrBase</title>
<author><name>Rhosyn &lt;Rhosyn@purplescarab.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200901.mbox/%3c1232128056.30824.95.camel@bjhlinux%3e"/>
<id>urn:uuid:%3c1232128056-30824-95-camel@bjhlinux%3e</id>
<updated>2009-01-16T17:47:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The attach patch fixes a thread safety issue we found with ObjectPtrBase
when we ported our application to a 64 bit platform.

It will only work if you are using a version of apr with
apr_atomic_xchgptr()


Cheers



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

</pre>
</div>
</content>
</entry>
</feed>
