<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>log4cxx-user@logging.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/</id>
<updated>2009-12-07T09:28:25Z</updated>
<entry>
<title>Re: How to build a x64 library on windows with Visual Studio?</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-user/200912.mbox/%3cA6F20971-B28A-4F3A-9D00-5F80666EE787@apache.org%3e"/>
<id>urn:uuid:%3cA6F20971-B28A-4F3A-9D00-5F80666EE787@apache-org%3e</id>
<updated>2009-12-04T03:53:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I do not believe that you should need to change any code.  Been a while since I've tested a
Win64 build, but I think the Ant driven VC++ build completed without issue.  Don't recall
the experience building within Visual Studio.

Likely a project file issue.  The .vcproj file in the release is generated from the Ant build
script, not Visual Studio, so it might be missing some features.  You could likely generate
an empty project file in Visual Studio and then copy the guts of the .vcproj in the release
and it would resolve the issue.

_WIN32 is defined for all Windows builds including x86_64 and Itanium builds.  _WIN64 is only
defined for 64-bit builds.  The only place you need to have _WIN64 is where the code differs
between 64 and 32 bit Windows and in general that is usually places where the _WIN64 code
would work with current 32-bit compilers but the 32-bit specific code will work with VC 6
and the like.

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to build a x64 library on windows with Visual Studio?</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200912.mbox/%3c3327549d0912020621w5e849bebg340ae9fa9403d34c@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0912020621w5e849bebg340ae9fa9403d34c@mail-gmail-com%3e</id>
<updated>2009-12-02T14:21:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Lars,

Thanks your response.

I have ported the log4cxx to a new VS2005 project which is defined to be x64
and build with APR, APR-util in the same solution. But I don't replace the
WIN32 with WIN64 and still use the WIN32 on windows64 platform. Though I got
some warning message when to build the APR libs, finally I build out the
log4cxx dll. And used it in my application, so far it works well.

Thanks,
Tom
2009/12/2 Lars Schouw &lt;schouwla@yahoo.com&gt;

&gt;  By replacing WIN32 with WIN64 I mean that you need to
&gt;
&gt; find all #ifdef WIN32 etc.. and replace them with #ifdef WIN64
&gt;
&gt;  ------------------------------
&gt; *From:* Lars Schouw &lt;schouwla@yahoo.com&gt;
&gt; *To:* Log4CXX User &lt;log4cxx-user@logging.apache.org&gt;
&gt; *Sent:* Wed, December 2, 2009 8:44:02 PM
&gt; *Subject:* Re: How to build a x64 library on windows with Visual Studio?
&gt;
&gt;  Hi Tom,
&gt;
&gt; You need to open the solution in VS2008 and then select build -&gt;
&gt; Configuration manager. Then select new under active platform and choose to
&gt; copy the win32 to x64. I the projects you need to replace WIN32 with WIN64.
&gt; There might be more you need to do... that is a good start.
&gt;
&gt; I assume is is the same under VS2005.
&gt;
&gt; Lars
&gt;
&gt;  ------------------------------
&gt; *From:* Zhou Tao &lt;zhoutao109@gmail.com&gt;
&gt; *To:* log4cxx-user@logging.apache.org
&gt; *Sent:* Fri, September 4, 2009 12:34:54 AM
&gt; *Subject:* How to build a x64 library on windows with Visual Studio?
&gt;
&gt; Hi all,
&gt;
&gt; I am trying to build the log4cxx libraries on a Windows x64 2003 server. I
&gt; use a Visual Studio 2005 as the compiling tool.
&gt;
&gt; I can build the APR, APR-UTIL with x64 option, however for log4cxx.dsp the
&gt; x64 option in Visual Studio 2005 is disabled.
&gt;
&gt; So how to use or build the log4cxx on a winx64 server.
&gt;
&gt; Thanks tons,
&gt;
&gt; Tom
&gt;
&gt;
&gt;


-- 
Thanks and Regards,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to build a x64 library on windows with Visual Studio?</title>
<author><name>Lars Schouw &lt;schouwla@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200912.mbox/%3c373230.69880.qm@web50303.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c373230-69880-qm@web50303-mail-re2-yahoo-com%3e</id>
<updated>2009-12-02T11:50:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
By replacing WIN32 with WIN64 I mean that you need to 

find all #ifdef WIN32 etc.. and replace them with #ifdef WIN64



________________________________
From: Lars Schouw &lt;schouwla@yahoo.com&gt;
To: Log4CXX User &lt;log4cxx-user@logging.apache.org&gt;
Sent: Wed, December 2, 2009 8:44:02 PM
Subject: Re: How to build a x64 library on windows with Visual Studio?


Hi Tom,

You need to open the solution in VS2008 and then select build -&gt; Configuration manager.
Then select new under active platform and choose to copy the win32 to x64. I the projects
you need to replace WIN32 with WIN64. There might be more you need to do... that is a good
start.

I assume is is the same under VS2005.

Lars



________________________________
From: Zhou Tao &lt;zhoutao109@gmail.com&gt;
To: log4cxx-user@logging.apache.org
Sent: Fri, September 4, 2009 12:34:54 AM
Subject: How to build a x64 library on windows with Visual Studio?


Hi all,
 
I am trying to build the log4cxx libraries on a Windows x64 2003 server. I use a Visual Studio
2005 as the compiling tool.
 
I can build the APR, APR-UTIL with x64 option, however for log4cxx.dsp the x64 option in Visual
Studio 2005 is disabled.
 
So how to use or build the log4cxx on a winx64 server.
 
Thanks tons,
 
Tom



      

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to build a x64 library on windows with Visual Studio?</title>
<author><name>Lars Schouw &lt;schouwla@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200912.mbox/%3c554098.9186.qm@web50305.mail.re2.yahoo.com%3e"/>
<id>urn:uuid:%3c554098-9186-qm@web50305-mail-re2-yahoo-com%3e</id>
<updated>2009-12-02T11:44:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Tom,

You need to open the solution in VS2008 and then select build -&gt; Configuration manager.
Then select new under active platform and choose to copy the win32 to x64. I the projects
you need to replace WIN32 with WIN64. There might be more you need to do... that is a good
start.

I assume is is the same under VS2005.

Lars



________________________________
From: Zhou Tao &lt;zhoutao109@gmail.com&gt;
To: log4cxx-user@logging.apache.org
Sent: Fri, September 4, 2009 12:34:54 AM
Subject: How to build a x64 library on windows with Visual Studio?


Hi all,
 
I am trying to build the log4cxx libraries on a Windows x64 2003 server. I use a Visual Studio
2005 as the compiling tool.
 
I can build the APR, APR-UTIL with x64 option, however for log4cxx.dsp the x64 option in Visual
Studio 2005 is disabled.
 
So how to use or build the log4cxx on a winx64 server.
 
Thanks tons,
 
Tom


      

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Problems executing application with log4cxx</title>
<author><name>carlos_jimenez@encopim.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c20091124132334.1vjy3gc9z40c8ssg@webmail.encopim.com%3e"/>
<id>urn:uuid:%3c20091124132334-1vjy3gc9z40c8ssg@webmail-encopim-com%3e</id>
<updated>2009-11-24T12:23:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The problem seems to be the size of log file, but now I have another problem.
If I want to use logger Sistema.RTEST, it doesn't work, but if I use  
rootLooger, works fine.


SistemaRTEST4Cilindres.cpp

#include "SistemaRTEST4Cilindres.h"

LoggerPtr loggerSistemaRTEST(Logger::getLogger("Sistema.RTEST"));
//LoggerPtr loggerSistemaRTEST(Logger::getRootLogger());

void SistemaRTEST4Cilindres::obrirTargetes(){
     LOG4CXX_INFO(loggerSistemaRTEST, "Abrimos los dispositivos para  
las targetas que tenemos");
     // EDITAR:
     targetes[iE6229_1]-&gt;open("/dev/comedi0");
}
....
The only difference with other examples is that this code is inside a  
directory.

main.cpp
Sistema/SistemaRTEST4Cilindres.h
Sistema/SistemaRTEST4Cilindres.cpp

I've tested in the main directoy and that worked correctly. That's  
what I'm doing wrong?

Thank you

Quoting carlos_jimenez@encopim.com:

&gt; Hello,
&gt;
&gt; First, sorry for my english.
&gt;
&gt; I'm new with log4cxx and I have problems. When I use
&gt; PropertyConfiguration into my code, application crashes, but if I use
&gt; BasicConfiguration, works fine.
&gt;
&gt; #include &lt;log4cxx/logger.h&gt;
&gt; #include &lt;log4cxx/propertyconfigurator.h&gt;
&gt; #include "Sistema/SistemaRTEST4Cilindres.h"
&gt;
&gt; using namespace log4cxx;
&gt;
&gt; LoggerPtr logger(Logger::getLogger("main"));
&gt;
&gt; int main(int argc, char *argv[]){
&gt;     SistemaRTEST4Cilindres *sistema=NULL;
&gt;
&gt;     PropertyConfigurator::configure("/etc/rtai/log/log4cxx.properties");
&gt;
&gt;     LOG4CXX_FATAL(logger, '\n');
&gt;     LOG4CXX_INFO(logger, "Programa main(): Cargamos el sistema");
&gt;
&gt; ....
&gt;
&gt;
&gt; /etc/rtai/log/log4cxx.properties
&gt;
&gt; # Sample ResourceBundle properties file
&gt; log4j.rootLogger=INFO, R
&gt;
&gt; log4j.appender.R=org.apache.log4j.RollingFileAppender
&gt; log4j.appender.R.File=/var/log/rtaid.log
&gt;
&gt; log4j.appender.R.MaxFileSize=200KB
&gt; log4j.appender.R.MaxBackupIndex=10
&gt;
&gt; log4j.appender.R.layout=org.apache.log4j.PatternLayout
&gt; log4j.appender.R.layout.ConversionPattern=%d [%t] %-3p (%F:%L) - %m%n
&gt;
&gt; log4j.logger.Cicle=WARN
&gt; log4j.logger.DadesFase=WARN
&gt; log4j.logger.Fase=WARN
&gt; log4j.logger.Modul=WARN
&gt; log4j.logger.Sistema=WARN
&gt; #log4j.logger.Sistema.RTEST=WARN
&gt; log4j.logger.Transicions=WARN
&gt; #log4j.logger.ServidorDades=WARN
&gt;
&gt;
&gt; My host OS is Debian, someone have any idea??
&gt;
&gt; Thank you.
&gt;
&gt;
&gt; -- 
&gt; Carlos Jiménez
&gt;
&gt; ENCOPIM S.L.
&gt; C/. del Parc 5 (nau 13), P.I. Els Pinetons
&gt; E-08291 RIPOLLET (Barcelona)
&gt; Tel: (+34) 935 94 23 47
&gt; Fax: (+34) 935 94 64 15
&gt;
&gt; ==========================================================
&gt; La información contenida en la presente transmisión es confidencial y su
&gt; uso únicamente está permitido a su(s) destinatario(s). Si Ud. no es la
&gt; persona destinataria de la presente transmisión, rogamos nos lo
&gt; comunique de manera inmediata por teléfono (+34 935 942 347) y destruya
&gt; cualquier copia de la misma (tanto digitales como en papel).
&gt;
&gt; The information contained in this transmission is confidential and is
&gt; intended only for the use of the addressee(s). If you are not the
&gt; designated recipient of this transmission, please advise us immediately
&gt; by telephone (+34 935 942 347) and destroy any copies (digital and
&gt; paper).
&gt; ==========================================================



-- 
Carlos Jiménez

ENCOPIM S.L.
C/. del Parc 5 (nau 13), P.I. Els Pinetons
E-08291 RIPOLLET (Barcelona)
Tel: (+34) 935 94 23 47
Fax: (+34) 935 94 64 15

==========================================================
La información contenida en la presente transmisión es confidencial y su
uso únicamente está permitido a su(s) destinatario(s). Si Ud. no es la
persona destinataria de la presente transmisión, rogamos nos lo
comunique de manera inmediata por teléfono (+34 935 942 347) y destruya
cualquier copia de la misma (tanto digitales como en papel).

The information contained in this transmission is confidential and is
intended only for the use of the addressee(s). If you are not the
designated recipient of this transmission, please advise us immediately
by telephone (+34 935 942 347) and destroy any copies (digital and
paper).
==========================================================


</pre>
</div>
</content>
</entry>
<entry>
<title>Problems executing application with log4cxx</title>
<author><name>carlos_jimenez@encopim.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c20091124130543.f8u0n1t258g08cgc@webmail.encopim.com%3e"/>
<id>urn:uuid:%3c20091124130543-f8u0n1t258g08cgc@webmail-encopim-com%3e</id>
<updated>2009-11-24T12:05:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

First, sorry for my english.

I'm new with log4cxx and I have problems. When I use  
PropertyConfiguration into my code, application crashes, but if I use  
BasicConfiguration, works fine.

#include &lt;log4cxx/logger.h&gt;
#include &lt;log4cxx/propertyconfigurator.h&gt;
#include "Sistema/SistemaRTEST4Cilindres.h"

using namespace log4cxx;

LoggerPtr logger(Logger::getLogger("main"));

int main(int argc, char *argv[]){
     SistemaRTEST4Cilindres *sistema=NULL;

     PropertyConfigurator::configure("/etc/rtai/log/log4cxx.properties");

     LOG4CXX_FATAL(logger, '\n');
     LOG4CXX_INFO(logger, "Programa main(): Cargamos el sistema");

....


/etc/rtai/log/log4cxx.properties

# Sample ResourceBundle properties file
log4j.rootLogger=INFO, R

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/var/log/rtaid.log

log4j.appender.R.MaxFileSize=200KB
log4j.appender.R.MaxBackupIndex=10

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-3p (%F:%L) - %m%n

log4j.logger.Cicle=WARN
log4j.logger.DadesFase=WARN
log4j.logger.Fase=WARN
log4j.logger.Modul=WARN
log4j.logger.Sistema=WARN
#log4j.logger.Sistema.RTEST=WARN
log4j.logger.Transicions=WARN
#log4j.logger.ServidorDades=WARN


My host OS is Debian, someone have any idea??

Thank you.


-- 
Carlos Jiménez

ENCOPIM S.L.
C/. del Parc 5 (nau 13), P.I. Els Pinetons
E-08291 RIPOLLET (Barcelona)
Tel: (+34) 935 94 23 47
Fax: (+34) 935 94 64 15

==========================================================
La información contenida en la presente transmisión es confidencial y su
uso únicamente está permitido a su(s) destinatario(s). Si Ud. no es la
persona destinataria de la presente transmisión, rogamos nos lo
comunique de manera inmediata por teléfono (+34 935 942 347) y destruya
cualquier copia de la misma (tanto digitales como en papel).

The information contained in this transmission is confidential and is
intended only for the use of the addressee(s). If you are not the
designated recipient of this transmission, please advise us immediately
by telephone (+34 935 942 347) and destroy any copies (digital and
paper).
==========================================================


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: LOG4CXX_DECODE_CHAR Crash on windows</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c3327549d0911172112s78d2026coa6a265c406ce15c1@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0911172112s78d2026coa6a265c406ce15c1@mail-gmail-com%3e</id>
<updated>2009-11-18T05:12:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Curt,

My comments in line.
*
*
*2009/11/18 Curt Arnold &lt;carnold@apache.org&gt;
*
&gt;
&gt; *Mismatching run-time libraries is a easy way to manufacture a crash.
&gt; Basically any time one DLL tries to deallocate some resource allocated by a
&gt; DLL using a different run time library (and that includes two DLLs that each
&gt; use /MT since they have the own instances of the run-time library), bad
&gt; things will happen.*
&gt;

Tom&gt;&gt; Yes, it's the problem.

&gt;
&gt; *To build a DLL using the /MT run-time library and log4cxx, add the
&gt; log4cxx source into your project and set the LOG4CXX_STATIC environment
&gt; variable.  If you try linking with a static library, you will only get the
&gt; classes that you call directly.  The ones that are expected to be present
&gt; when the configuration is read will not have been linked into your DLL.*
&gt;

Tom&gt;&gt; Do you mean to build the log4cxx source into my DLL?
My context is to build the log4cxx to a DLL and the log4cxx DLL would be
called in my DLL( build with /MT option). Mostly I cannot combine the
log4cxx code with my DLL code together. I maybe misunderstand you about your
way to handle the issue.

Regards,
Tom





-- 
Thanks and Regards,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: LOG4CXX_DECODE_CHAR Crash on windows</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-user/200911.mbox/%3c61B6254E-52B1-43F1-80EF-24E2D382C874@apache.org%3e"/>
<id>urn:uuid:%3c61B6254E-52B1-43F1-80EF-24E2D382C874@apache-org%3e</id>
<updated>2009-11-18T03:29:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Mismatching run-time libraries is a easy way to manufacture a crash.    
Basically any time one DLL tries to deallocate some resource allocated  
by a DLL using a different run time library (and that includes two  
DLLs that each use /MT since they have the own instances of the run- 
time library), bad things will happen.

To build a DLL using the /MT run-time library and log4cxx, add the  
log4cxx source into your project and set the LOG4CXX_STATIC  
environment variable.  If you try linking with a static library, you  
will only get the classes that you call directly.  The ones that are  
expected to be present when the configuration is read will not have  
been linked into your DLL.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: LOG4CXX_DECODE_CHAR Crash on windows</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c3327549d0911170039i5d798d34xaf9ddddf224077ad@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0911170039i5d798d34xaf9ddddf224077ad@mail-gmail-com%3e</id>
<updated>2009-11-17T08:39:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I take a look at the problem. The issue is caused by using mixed MT/MD
option in one process. My DLL is using MT option and log4cxx is using MD, so
they are using different copy of CRT lib. I call the LOG4CXX_DECODE_CHAR
macro within my DLL to create a LogString variable then get the fail. (
note: in debug mode on windows32).

Macro:
#define LOG4CXX_DECODE_CHAR(var, src) \
log4cxx::LogString var; \
log4cxx::helpers::Transcoder::decode(src, var)

I check the Transcoder::decode(const std::string&amp; src, LogString&amp; dst)
function,

dst.reserve(dst.size()+src.size());

The above statement maybe allocate new bytes in the CRT heap used by
log4cxx, but the dst variable would be freed in my DLL if I use the macro.
The two DLLs have two different copy of CRT libs. So cause a heap corruption
error.

I understand if all DLLs are build with MD option, then OK.

So my question is,
1. the macro LOG4CXX_DECODE_CHAR(var, src) is only used for log4cxx DLL
internally?
2. Why not to only fill the memory in decode function, but not to change the
size of the passed-in CRT objects? It's a rule I often use. I mean to change
the size of dst object some where outside of the decode function.
3. Is it possible to create other ways to generate a logstring based on the
std::string content?

Thanks,
Tom


2009/11/13 Zhou Tao &lt;zhoutao109@gmail.com&gt;

&gt; Hi all,
&gt;
&gt; I am using log4cxx on win32 platform and  build the log4cxx with MT option(
&gt; Runtime Library) within MS visual Studio 2005. The project default setting
&gt; is MD. All APR, APR-UTIL and LOG4CXX projects are set to be MT mode.
&gt;
&gt; After the build, I get a crash in the LOG4CXX_DECODE_CHAR macro. The code
&gt; is very simple, looks like the below,
&gt;
&gt; void testFun()
&gt; {
&gt; std::string src = "log4cxx-string-testing";
&gt; LOG4CXX_DECODE_CHAR(dest, src);
&gt; }
&gt;
&gt; The crash happens when leave the function when trying to delete the
&gt; allocated memory. If the length of the src string is less than 7, it works.
&gt;
&gt; Is this a problem?
&gt;
&gt; --
&gt; Thanks and Regards,
&gt; Tom
&gt;



-- 
Thanks and Regards,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Compilation Error -Log4cxx 0.10.0 on AS3 Redhat Linux (gcc2.96)]</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-user/200911.mbox/%3c763098AA-D17D-4ED9-90C1-CE4F36A54213@apache.org%3e"/>
<id>urn:uuid:%3c763098AA-D17D-4ED9-90C1-CE4F36A54213@apache-org%3e</id>
<updated>2009-11-16T03:56:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
When I checked the archives, it appears that you have reported this  
before.  From log4cxx-user in July 12, 2008 I replied:
&gt;
&gt; gcc 2.96 was a prerelease version of gcc 3.x and has an incomplete  
&gt; implementation of the C++ Standard Template Library (see http://gcc.gnu.org/gcc-2.96.html

&gt; ) . I have been able to get messagebuffer.h to compile by forward  
&gt; declaring std::ios_base and replacing std::basic_ostream&lt;char&gt; with  
&gt; std::ostream and similar changes, but there are also compilation  
&gt; failures in cachedateformat.cpp and properties.h and there may be  
&gt; others. I do not intend to work around gcc 2.96's limitation.
&gt;

gcc 2.96 is an odd-ball compiler disavowed by the gcc team.  I'm not  
saying that I'd be opposed to integrating patches to work around its  
limitations as long as it doesn't compromise current and/or standard  
compliant compilers.  However, there is nothing that motivates me to  
work through the issues with this compiler for you.


</pre>
</div>
</content>
</entry>
<entry>
<title>Compilation Error -Log4cxx 0.10.0 on AS3 Redhat Linux (gcc2.96)]</title>
<author><name>Srk Raju &lt;ramakrishnaraju.sammeta@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c826bf3280911130230j7a21bc40x9136cfb76830d91e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c826bf3280911130230j7a21bc40x9136cfb76830d91e@mail-gmail-com%3e</id>
<updated>2009-11-13T10:30:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am able to compile apr, aprutil and successfully generated the libraries.
When I try to make log4cxx libraries, getting the following error.

    Errors:
1. src/main/include/log4cxx/helpers/messagebuffer.h:158: `::basic_ostream'
undeclared (first use here)
2. src/main/include/log4cxx/helpers/messagebuffer.h:194:
`CharMessageBuffer' was not declared in this scope
3. src/main/include/log4cxx/helpers/messagebuffer.h:194: `os' was not
declared in this scope
4. src/main/include/log4cxx/helpers/messagebuffer.h:194:
`log4cxx::helpers::operator&lt;&lt; (...)' must have an argument of class or
enumerated type
5. /src/main/include/log4cxx/helpers/messagebuffer.h:195: `val' undeclared
6. /src/main/include/log4cxx/logger.h:44: `LoggerRepository' was not
declared in this scope

Any suggestions please.

Regards
SrkRaju



______________________________________________________________________________

DISCLAIMER

The information contained in this e-mail message and/or attachments to it
may
contain confidential or privileged information. If you are not the intended
recipient, any dissemination, use, review, distribution, printing or copying
of the information contained in this e-mail message and/or attachments to it
are strictly prohibited. If you have received this communication in error,
please notify us by reply e-mail or directly to netsupport@cmcltd.com or
telephone and immediately and permanently delete the message and any
attachments. Thank you.


______________________________________________________________________________

This email has been scrubbed for your protection by SecureMX.
For more information visit http://securemx.in
______________________________________________________________________________




-- 
Thanks&amp; Regards,
S. Ramakrishna Raju
phone: 919441432458


</pre>
</div>
</content>
</entry>
<entry>
<title>LOG4CXX_DECODE_CHAR Crash on windows</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c3327549d0911130156w44a2a36br7ad26adddeb096ae@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0911130156w44a2a36br7ad26adddeb096ae@mail-gmail-com%3e</id>
<updated>2009-11-13T09:56:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

I am using log4cxx on win32 platform and  build the log4cxx with MT option(
Runtime Library) within MS visual Studio 2005. The project default setting
is MD. All APR, APR-UTIL and LOG4CXX projects are set to be MT mode.

After the build, I get a crash in the LOG4CXX_DECODE_CHAR macro. The code is
very simple, looks like the below,

void testFun()
{
std::string src = "log4cxx-string-testing";
LOG4CXX_DECODE_CHAR(dest, src);
}

The crash happens when leave the function when trying to delete the
allocated memory. If the length of the src string is less than 7, it works.

Is this a problem?

-- 
Thanks and Regards,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: problem with install 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-user/200911.mbox/%3c36F2103A-4D0A-46E4-BCDD-2E5EE9916613@apache.org%3e"/>
<id>urn:uuid:%3c36F2103A-4D0A-46E4-BCDD-2E5EE9916613@apache-org%3e</id>
<updated>2009-11-13T04:40:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Nov 10, 2009, at 4:52 AM, Bajramovic, Ervin wrote:

&gt; Hi everybody
&gt;
&gt; I want to build log4cxx
&gt;
&gt; I used the following configuration:
&gt;
&gt; ./autogen.sh
&gt;
&gt; ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2  
&gt; -s -mms-bitfields -march=i686" --with-apr=/usr/local --with-apr- 
&gt; util=/usr/local
&gt;
&gt; make &amp;&amp; make install
&gt;
&gt; And i get this error:
...
&gt; test -z "/usr/local/include/log4cxx/private" || /bin/mkdir -p "/usr/ 
&gt; local/include/log4cxx/private"
&gt; /bin/install -c -m 644 ../../../../../src/main/include/log4cxx/ 
&gt; private/log4cxx_private.h log4cxx_private.h '/usr/local/include/ 
&gt; log4cxx/private'
&gt; /bin/install: will not overwrite just-created `/usr/local/include/ 
&gt; log4cxx/private/log4cxx_private.h' with `log4cxx_private.h'
&gt; make[6]: *** [install-privateincHEADERS] Error 1


Since you are failing to write to /usr/local, I'm guessing it is a  
permissions issue and you need to do "sudo make install" or the  
equivalent.


</pre>
</div>
</content>
</entry>
<entry>
<title>problem with install log4cxx</title>
<author><name>&quot;Bajramovic, Ervin&quot; &lt;Ervin.Bajramovic@dsm.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3cF55737CE788F3B4BAF50E0CDFD4A8A51012D19976C@defam10w3ms004.CORPAD.DSM-GROUP.COM%3e"/>
<id>urn:uuid:%3cF55737CE788F3B4BAF50E0CDFD4A8A51012D19976C@defam10w3ms004-CORPAD-DSM-GROUP-COM%3e</id>
<updated>2009-11-10T10:52:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi everybody

I want to build log4cxx

I used the following configuration:

./autogen.sh

./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686"
--with-apr=/usr/local --with-apr-util=/usr/local

make &amp;&amp; make install

And i get this error:

Making install in db
make[5]: Entering directory `/home/lab409/log4cxx/src/main/include/log4cxx/db'
make[6]: Entering directory `/home/lab409/log4cxx/src/main/include/log4cxx/db'
make[6]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/log4cxx/db" || /bin/mkdir -p "/usr/local/include/log4cxx/db"
 /bin/install -c -m 644 ../../../../../src/main/include/log4cxx/db/odbcappender.h '/usr/local/include/log4cxx/db'
make[6]: Leaving directory `/home/lab409/log4cxx/src/main/include/log4cxx/db'
make[5]: Leaving directory `/home/lab409/log4cxx/src/main/include/log4cxx/db'
Making install in private
make[5]: Entering directory `/home/lab409/log4cxx/src/main/include/log4cxx/private'
make[6]: Entering directory `/home/lab409/log4cxx/src/main/include/log4cxx/private'
make[6]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include/log4cxx/private" || /bin/mkdir -p "/usr/local/include/log4cxx/private"
 /bin/install -c -m 644 ../../../../../src/main/include/log4cxx/private/log4cxx_private.h
log4cxx_private.h '/usr/local/include/log4cxx/private'
/bin/install: will not overwrite just-created `/usr/local/include/log4cxx/private/log4cxx_private.h'
with `log4cxx_private.h'
make[6]: *** [install-privateincHEADERS] Error 1
make[6]: Leaving directory `/home/lab409/log4cxx/src/main/include/log4cxx/private'
make[5]: *** [install-am] Error 2
make[5]: Leaving directory `/home/lab409/log4cxx/src/main/include/log4cxx/private'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/home/lab409/log4cxx/src/main/include/log4cxx'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/lab409/log4cxx/src/main/include'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/lab409/log4cxx/src/main'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/lab409/log4cxx/src'
make: *** [install-recursive] Error 1

I tested it with the packe from the apache download mirror Log4cxx-0.10.0
and with de svn source from svn.apache.org/repos/asf/logging/log4cxx/trunk/
Asf - Revision 834383 and got the same error.

Can enybody tell mi how to fix it

Ervin Bajramovic



  ________________________________
DISCLAIMER :
This e-mail is for the intended recipient only
If you have received it by mistake please let us know by reply and then delete it from your
system; access, disclosure, copying, distribution or reliance on any of it by anyone else
is prohibited.
If you as intended recipient have received this e-mail incorrectly, please notify the sender
(via e-mail) immediately.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Memory Leak with MFC</title>
<author><name>Yamawaki Kenichi &lt;k-yamawaki@carinasystem.co.jp&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c4AF766FB.2090706@carinasystem.co.jp%3e"/>
<id>urn:uuid:%3c4AF766FB-2090706@carinasystem-co-jp%3e</id>
<updated>2009-11-09T00:48:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
thanks Patrick, Cory,

I've understood that these are not memory leak.
They are side effects of ordering of destruction.
and I ran my sample program 3 times.
the allocation numbers are consistent.


&gt; Patrick is right. Run it a few times and see if the allocation numbers
&gt; change (124, 1151, and 1152). If you can get it to repeat consistently,
&gt; set a breakpoint at those allocations to see what it is that's leaking.
&gt; 
&gt; You could also rebuild using the debug version of new. That way, you
&gt; will get file and line numbers in the memory dumps.
&gt; 
&gt; -cory
&gt; 
&gt; 
&gt; Griffiths, Patrick wrote:
&gt;&gt; This doesn't show that the leak is or is not log4cxx.
&gt;&gt;
&gt;&gt; Keep in mind that log4cxx uses static singleton objects. It's quite possible that
what you are seeing is a simply a side effect caused by the ordering of the destruction of
static objects.
&gt;&gt;
&gt;&gt; -----Original Message-----
&gt;&gt; From: "山脇健一(Yamawaki Kenichi)" [mailto:k-yamawaki@carinasystem.co.jp]
&gt;&gt; Sent: Wednesday, November 04, 2009 5:23 PM
&gt;&gt; To: log4cxx-user@logging.apache.org
&gt;&gt; Subject: Memory Leak with MFC
&gt;&gt;
&gt;&gt; Hi Exparts,
&gt;&gt;
&gt;&gt; I use the log4cxx-0.10.0.
&gt;&gt; I made below programs with MFC. Then I have faced a certain memory leak.
&gt;&gt; Please teach the method of settlement.
&gt;&gt;
&gt;&gt; // leak version (with MFC)
&gt;&gt; BOOL CLogTestDlg::OnInitDialog()
&gt;&gt; {
&gt;&gt;         CDialog::OnInitDialog();
&gt;&gt;         LoggerPtr       logger = Logger::getLogger( "test" );
&gt;&gt;         return TRUE;
&gt;&gt; }
&gt;&gt;
&gt;&gt; -----------------------------------------------------------------
&gt;&gt; Detected memory leaks!
&gt;&gt; Dumping objects -&gt;
&gt;&gt; {1152} normal block at 0x01B08818, 56 bytes long.
&gt;&gt;  Data: &lt;0 n 0 n 0 n     &gt; 30 F1 6E 02 30 F1 6E 02 30 F1 6E 02 00 00 00 00
&gt;&gt; {1151} normal block at 0x01B08768, 116 bytes long.
&gt;&gt;  Data: &lt;Lb  db   -n     &gt; 4C 62 1D 10 64 62 1D 10 8C 2D 6E 02 00 00 00 00
&gt;&gt;
&gt;&gt;     -----Omission ------
&gt;&gt;
&gt;&gt; {124} normal block at 0x01B02218, 52 bytes long.
&gt;&gt;  Data: &lt; P   l  P       &gt; C8 50 B0 01 90 6C B0 01 50 BA B0 01 CD CD CD CD
&gt;&gt; -----------------------------------------------------------------
&gt;&gt;
&gt;&gt; // A program without MFC doesn't leak memory.
&gt;&gt; int _tmain(int argc, _TCHAR* argv[])
&gt;&gt; {
&gt;&gt;         LoggerPtr       logger  = Logger::getLogger("test");
&gt;&gt;         return 0;
&gt;&gt; }
&gt;&gt;
&gt;&gt; thanks,
&gt;&gt; Kenichi
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; This e-mail contains privileged and confidential information intended for the use
of the addressees named above. If you are not the intended recipient of this e-mail, you are
hereby notified that you must not disseminate, copy or take any action in respect of any information
contained in it. If you have received this e-mail in error, please notify the sender immediately
by e-mail and immediately destroy this e-mail and its attachments.
&gt;&gt;
&gt;&gt;
&gt;&gt;   
&gt; 
&gt; 


-- 
Kenichi Yamawaki
carina system co.,ltd.
E-mail:k-yamawaki@carinasystem.co.jp
TEL +81-78-954-5231



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Memory Leak with MFC</title>
<author><name>Cory Riddell &lt;cory@codeware.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c4AF2F028.1010201@codeware.com%3e"/>
<id>urn:uuid:%3c4AF2F028-1010201@codeware-com%3e</id>
<updated>2009-11-05T15:32:56Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Patrick is right. Run it a few times and see if the allocation numbers
change (124, 1151, and 1152). If you can get it to repeat consistently,
set a breakpoint at those allocations to see what it is that's leaking.

You could also rebuild using the debug version of new. That way, you
will get file and line numbers in the memory dumps.

-cory


Griffiths, Patrick wrote:
&gt; This doesn't show that the leak is or is not log4cxx.
&gt;
&gt; Keep in mind that log4cxx uses static singleton objects. It's quite possible that what
you are seeing is a simply a side effect caused by the ordering of the destruction of static
objects.
&gt;
&gt; -----Original Message-----
&gt; From: "山脇健一(Yamawaki Kenichi)" [mailto:k-yamawaki@carinasystem.co.jp]
&gt; Sent: Wednesday, November 04, 2009 5:23 PM
&gt; To: log4cxx-user@logging.apache.org
&gt; Subject: Memory Leak with MFC
&gt;
&gt; Hi Exparts,
&gt;
&gt; I use the log4cxx-0.10.0.
&gt; I made below programs with MFC. Then I have faced a certain memory leak.
&gt; Please teach the method of settlement.
&gt;
&gt; // leak version (with MFC)
&gt; BOOL CLogTestDlg::OnInitDialog()
&gt; {
&gt;         CDialog::OnInitDialog();
&gt;         LoggerPtr       logger = Logger::getLogger( "test" );
&gt;         return TRUE;
&gt; }
&gt;
&gt; -----------------------------------------------------------------
&gt; Detected memory leaks!
&gt; Dumping objects -&gt;
&gt; {1152} normal block at 0x01B08818, 56 bytes long.
&gt;  Data: &lt;0 n 0 n 0 n     &gt; 30 F1 6E 02 30 F1 6E 02 30 F1 6E 02 00 00 00 00
&gt; {1151} normal block at 0x01B08768, 116 bytes long.
&gt;  Data: &lt;Lb  db   -n     &gt; 4C 62 1D 10 64 62 1D 10 8C 2D 6E 02 00 00 00 00
&gt;
&gt;     -----Omission ------
&gt;
&gt; {124} normal block at 0x01B02218, 52 bytes long.
&gt;  Data: &lt; P   l  P       &gt; C8 50 B0 01 90 6C B0 01 50 BA B0 01 CD CD CD CD
&gt; -----------------------------------------------------------------
&gt;
&gt; // A program without MFC doesn't leak memory.
&gt; int _tmain(int argc, _TCHAR* argv[])
&gt; {
&gt;         LoggerPtr       logger  = Logger::getLogger("test");
&gt;         return 0;
&gt; }
&gt;
&gt; thanks,
&gt; Kenichi
&gt;
&gt;
&gt;
&gt;
&gt; This e-mail contains privileged and confidential information intended for the use of
the addressees named above. If you are not the intended recipient of this e-mail, you are
hereby notified that you must not disseminate, copy or take any action in respect of any information
contained in it. If you have received this e-mail in error, please notify the sender immediately
by e-mail and immediately destroy this e-mail and its attachments.
&gt;
&gt;
&gt;   


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Memory Leak with MFC</title>
<author><name>&quot;Griffiths, Patrick&quot; &lt;pgriffiths@tycothermal.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c4A29963266F94B4687C5260083B1D266252715580A@TFC-NAMSG-01.mgdtfc.tycoflowcontrol.com%3e"/>
<id>urn:uuid:%3c4A29963266F94B4687C5260083B1D266252715580A@TFC-NAMSG-01-mgdtfc-tycoflowcontrol-com%3e</id>
<updated>2009-11-05T14:39:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This doesn't show that the leak is or is not log4cxx.

Keep in mind that log4cxx uses static singleton objects. It's quite possible that what you
are seeing is a simply a side effect caused by the ordering of the destruction of static objects.

-----Original Message-----
From: "$B;3OF7r0l(B(Yamawaki Kenichi)" [mailto:k-yamawaki@carinasystem.co.jp]
Sent: Wednesday, November 04, 2009 5:23 PM
To: log4cxx-user@logging.apache.org
Subject: Memory Leak with MFC

Hi Exparts,

I use the log4cxx-0.10.0.
I made below programs with MFC. Then I have faced a certain memory leak.
Please teach the method of settlement.

// leak version (with MFC)
BOOL CLogTestDlg::OnInitDialog()
{
        CDialog::OnInitDialog();
        LoggerPtr       logger = Logger::getLogger( "test" );
        return TRUE;
}

-----------------------------------------------------------------
Detected memory leaks!
Dumping objects -&gt;
{1152} normal block at 0x01B08818, 56 bytes long.
 Data: &lt;0 n 0 n 0 n     &gt; 30 F1 6E 02 30 F1 6E 02 30 F1 6E 02 00 00 00 00
{1151} normal block at 0x01B08768, 116 bytes long.
 Data: &lt;Lb  db   -n     &gt; 4C 62 1D 10 64 62 1D 10 8C 2D 6E 02 00 00 00 00

    -----Omission ------

{124} normal block at 0x01B02218, 52 bytes long.
 Data: &lt; P   l  P       &gt; C8 50 B0 01 90 6C B0 01 50 BA B0 01 CD CD CD CD
-----------------------------------------------------------------

// A program without MFC doesn't leak memory.
int _tmain(int argc, _TCHAR* argv[])
{
        LoggerPtr       logger  = Logger::getLogger("test");
        return 0;
}

thanks,
Kenichi




This e-mail contains privileged and confidential information intended for the use of the addressees
named above. If you are not the intended recipient of this e-mail, you are hereby notified
that you must not disseminate, copy or take any action in respect of any information contained
in it. If you have received this e-mail in error, please notify the sender immediately by
e-mail and immediately destroy this e-mail and its attachments.



</pre>
</div>
</content>
</entry>
<entry>
<title>Memory Leak with MFC</title>
<author><name>=?ISO-2022-JP?B?IhskQjszT0Y3cjBsGyhCKFlhbWF3YWtpIEtlbmljaGkpIg==?= &lt;k-yamawaki@carinasystem.co.jp&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200911.mbox/%3c4AF21AE6.6050105@carinasystem.co.jp%3e"/>
<id>urn:uuid:%3c4AF21AE6-6050105@carinasystem-co-jp%3e</id>
<updated>2009-11-05T00:23:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Exparts,

I use the log4cxx-0.10.0.
I made below programs with MFC. Then I have faced a certain memory leak.
Please teach the method of settlement.

// leak version (with MFC)
BOOL CLogTestDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	LoggerPtr	logger = Logger::getLogger( "test" );
	return TRUE;
}

-----------------------------------------------------------------
Detected memory leaks!
Dumping objects -&gt;
{1152} normal block at 0x01B08818, 56 bytes long.
 Data: &lt;0 n 0 n 0 n     &gt; 30 F1 6E 02 30 F1 6E 02 30 F1 6E 02 00 00 00 00
{1151} normal block at 0x01B08768, 116 bytes long.
 Data: &lt;Lb  db   -n     &gt; 4C 62 1D 10 64 62 1D 10 8C 2D 6E 02 00 00 00 00

    -----Omission ------

{124} normal block at 0x01B02218, 52 bytes long.
 Data: &lt; P   l  P       &gt; C8 50 B0 01 90 6C B0 01 50 BA B0 01 CD CD CD CD
-----------------------------------------------------------------

// A program without MFC doesn't leak memory.
int _tmain(int argc, _TCHAR* argv[])
{
	LoggerPtr	logger	= Logger::getLogger("test");
	return 0;
}

thanks,
Kenichi





</pre>
</div>
</content>
</entry>
<entry>
<title>ant build options not working on Windows? (unichar, wchar_t, etc)</title>
<author><name>Samuel Gundry &lt;sam.gundry@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3cbdc352cb0910292314l6c4e6823n44236b82f59cc7be@mail.gmail.com%3e"/>
<id>urn:uuid:%3cbdc352cb0910292314l6c4e6823n44236b82f59cc7be@mail-gmail-com%3e</id>
<updated>2009-10-30T06:14:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I'm tangling with log4cxx and going under...

I'm on Windows XP and using MSVC9 and used the following:
- apache-log4cxx-0.10.0.tar.gz
- apr-util-1.2.12.tar.gz                     (the latest didn't work,
can't remember the reason)
- apr-1.2.12.tar.gz                          (same again, latest
version didn't work)
- cpptasks-1.0b5                           (and built cpptasks.jar using ant)
- ant-contrib-1.0b5-bin                    (came with ant-contrib-1.0b3.jar)

(ant couldn't find tools.jar either. I 'solved' this by copying it
from the jdk/lib int jre/lib too, probably should've fixed paths or
something but ...)

Sorry for the long post. Please pick it apart and just answer what you
can or want. Thanks heaps for any help!


So to begin,  I have log4cxx building via ant:

$ant -Dfind=false

The library files are built and passes most but not all tests. I've
used it and it is logging. Fine. Great. Okay...

If I want to modify the build options, do I use the command line args
(-D...) or modify log4cxx.hw? The former doesn't seem to be working
for me.  That is, when I modify the build options, say
-Denable-wchar_t=yes, they don't seem to effect the generated
log4cxx.h.

So, if I run:
$ant -Dfind=false -Denable-wchar_t=yes -Denable-unichar=yes
-Dwith-logchar=wchar_t

generates the log4cxx.h as:
#define LOG4CXX_LOGCHAR_IS_UTF8 0
#if LOG4CXX_LOGCHAR_IS_UTF8
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#else
#define LOG4CXX_LOGCHAR_IS_WCHAR 1
#endif
#define LOG4CXX_LOGCHAR_IS_UNICHAR 0

#define LOG4CXX_CHAR_API 1
#define LOG4CXX_WCHAR_T_API 1
#define LOG4CXX_UNICHAR_API 0
#define LOG4CXX_CFSTRING_API 0


Why isn't LOG4CXX_UNICHAR_API  = 1?  What isn't
LOG4CXX_LOGCHAR_IS_UNICHAR = 1? Does it not make sense to have both
wchar_t and unichar enabled?

So, if I run:
$ant -Dfind=false -Denable-wchar_t=no -Denable-unichar=yes
-Dwith-logchar=unichar

#define LOG4CXX_LOGCHAR_IS_UTF8 0
#if LOG4CXX_LOGCHAR_IS_UTF8
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#else
#define LOG4CXX_LOGCHAR_IS_WCHAR 1
#endif
#define LOG4CXX_LOGCHAR_IS_UNICHAR 0

#define LOG4CXX_CHAR_API 1
#define LOG4CXX_WCHAR_T_API 1
#define LOG4CXX_UNICHAR_API 0
#define LOG4CXX_CFSTRING_API


No change.


So, now to try and use UTF8 and no wide characters:
$ant -Dfind=false -Denable-wchar_t=no -Denable -Dwith-logchar=utf-8

#define LOG4CXX_LOGCHAR_IS_UTF8 0
#if LOG4CXX_LOGCHAR_IS_UTF8
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#else
#define LOG4CXX_LOGCHAR_IS_WCHAR 1
#endif
#define LOG4CXX_LOGCHAR_IS_UNICHAR 0

#define LOG4CXX_CHAR_API 1
#define LOG4CXX_WCHAR_T_API 1
#define LOG4CXX_UNICHAR_API 0
#define LOG4CXX_CFSTRING_API


Again, no change.


So I've been modifying log4cxx.hw.  I seem to have wchar_t and utf-8
working independently. Can these be compiled into the same shared
library? Or do I need separate ones? And how should I handle the
modified header log4cxx.h when putting it into a dependency / 3rd
party folder? I.e., two includes folders?

However, back to the build. When I set the following, I get many
errors (can post if needed):
#define LOG4CXX_LOGCHAR_IS_UTF8 0
#if LOG4CXX_LOGCHAR_IS_UTF8
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#else
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#endif
#define LOG4CXX_LOGCHAR_IS_UNICHAR 1

#define LOG4CXX_CHAR_API 0
#define LOG4CXX_WCHAR_T_API 0
#define LOG4CXX_UNICHAR_API 1
#define LOG4CXX_CFSTRING_API


These are reduced when I include the char and wchar APIs...
#define LOG4CXX_LOGCHAR_IS_UTF8 0
#if LOG4CXX_LOGCHAR_IS_UTF8
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#else
#define LOG4CXX_LOGCHAR_IS_WCHAR 0
#endif
#define LOG4CXX_LOGCHAR_IS_UNICHAR 1

#define LOG4CXX_CHAR_API 1
#define LOG4CXX_WCHAR_T_API 1
#define LOG4CXX_UNICHAR_API 1
#define LOG4CXX_CFSTRING_API

...to:
- ndc.cpp(265) : error C2039: 'message' : is not a member of
'std::pair&lt;_Ty1,_Ty2&gt;'
- ndc.cpp(282) : error C2039: 'message' : is not a member of
'std::pair&lt;_Ty1,_Ty2&gt;'
- transcoder.cpp(35) : fatal error C1083: Cannot open include file:
'CoreFoundation/CFString.h': No such file or directory.

I looked at ndc.cpp and hacked / changed both lines 265 &amp; 282 from:
Transcoder::encode(stack.top().message, dst);
to:
Transcoder::encode(getMessage(stack.top()), dst);

I had no idea and didn't look into it but it compiled; I was desperate.

But the second error is not hackable. Why is CoreFoundation required?

#if LOG4CXX_LOGCHAR_IS_UNICHAR || LOG4CXX_CFSTRING_API || LOG4CXX_UNICHAR_API
#include &lt;CoreFoundation/CFString.h&gt;
#endif


What I have I misunderstood?

The following doesn't complain (compile or run-time) but it the
characters appears as question marks in the output:
LOG4CXX_DEBUG(logger, LOG4CXX_STR("the message u30A8\u30FC\u30B8\u30A7"))

I guess it is something to do with the "with-charset" but I can't
modify the build options (-Dwith-charset) and I don't know where else
to modify this...

Again, sorry for the long post. Hopefully it makes sense - it is a
Friday night after all.

Cheers,
Sam


</pre>
</div>
</content>
</entry>
<entry>
<title>Building log4cxx</title>
<author><name>Vinay Maddi &lt;vinay.maddi@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c21eb572b0910221719q66032252xea4875d13aaf2338@mail.gmail.com%3e"/>
<id>urn:uuid:%3c21eb572b0910221719q66032252xea4875d13aaf2338@mail-gmail-com%3e</id>
<updated>2009-10-23T00:19:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello All,

I am building log4cxx using Makefile. Everything works fine. I have one
question though.
I am trying to write my own appender. This appender uses axis2c libraries. I
put my appender in log4cxx src and building. But since my appender uses
axis2C libraries, I need to link axis2C libraries to log4cxx while building.

I tried adding libraries in Makefile (LDFLAGS ). But its not working.

Could some point me in the right direction.

Thanks
Vinay

On Thu, Oct 22, 2009 at 11:18 AM, Moshe Matitya
&lt;Moshe.Matitya@xconnect.net&gt;wrote:

&gt;  I have been trying, unsuccessfully, to figure out how to install log4cxx
&gt; on Linux with Ant.
&gt;
&gt;
&gt;
&gt; In the past, when installing log4cxx 0.9.7 on a Linux machine, I would
&gt; build and install it using Make, as follows:  To build it, I would run the
&gt; following commands:
&gt;
&gt;             autogen.sh
&gt;
&gt;             configure
&gt;
&gt;             make
&gt;
&gt; Then, to install it, I would simply run:
&gt;
&gt;             make install
&gt;
&gt; This would install all the library files, include files, etc., in their
&gt; proper locations.
&gt;
&gt;
&gt;
&gt; Now, however, I am using log4cxx 0.10.0, which I build using Ant.  The
&gt; default target in the Ant build script compiles and links the sources, and
&gt; runs the unit tests.  However, I don't see how one is supposed to then
&gt; install it, and I can't find any instructions about how to do this in the
&gt; documentation.
&gt;
&gt;
&gt;
&gt; There doesn't seem to be a target in the Ant build script called "install",
&gt; or anything similar.  So how does one install log4cxx when using Ant?
&gt;
&gt;
&gt;
&gt; Thanks,
&gt;
&gt;
&gt;
&gt; Moshe Z. Matitya
&gt;
&gt; XConnect Global Networks
&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Installing log4cxx on Linux with Ant</title>
<author><name>Moshe Matitya &lt;Moshe.Matitya@xconnect.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c6EA53FAD386F9D46B97D49BFE148D5140606E8F4@ISR-JLM-MAIL1.xconnect.co.il%3e"/>
<id>urn:uuid:%3c6EA53FAD386F9D46B97D49BFE148D5140606E8F4@ISR-JLM-MAIL1-xconnect-co-il%3e</id>
<updated>2009-10-22T20:16:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
No, not really.  install-sh is not a script for installing log4cxx, it's just a general utility
that does little more than copy a specified file from one place to another.  In order to use
install-sh to install log4cxx, I'd first need to know exactly which files are supposed to
be installed, and where.  This information is not documented anywhere that I know of.  And
if I were to take the time and trouble to figure out that information, then install-sh would
provide very little advantage over simply using cp and chmod.

It seems to me that there ought to be some way to install log4cxx using Ant, just like there
is with Make.  I can't be the first person who's run into this problem.  How does everyone
else install log4cxx on Linux/Unix?

Moshe


________________________________
From: Cory Riddell [cory@codeware.com]
Sent: Thursday, October 22, 2009 8:30 PM
To: Log4CXX User
Subject: Re: Installing log4cxx on Linux with Ant

Does the install-sh script do what you want?

Moshe Matitya wrote:
I have been trying, unsuccessfully, to figure out how to install log4cxx on Linux with Ant.

In the past, when installing log4cxx 0.9.7 on a Linux machine, I would build and install it
using Make, as follows:  To build it, I would run the following commands:
            autogen.sh
            configure
            make
Then, to install it, I would simply run:
            make install
This would install all the library files, include files, etc., in their proper locations.

Now, however, I am using log4cxx 0.10.0, which I build using Ant.  The default target in the
Ant build script compiles and links the sources, and runs the unit tests.  However, I don't
see how one is supposed to then install it, and I can't find any instructions about how to
do this in the documentation.

There doesn't seem to be a target in the Ant build script called "install", or anything similar.
 So how does one install log4cxx when using Ant?

Thanks,

Moshe Z. Matitya
XConnect Global Networks



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Installing log4cxx on Linux with Ant</title>
<author><name>Cory Riddell &lt;cory@codeware.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c4AE0A4BC.4010400@codeware.com%3e"/>
<id>urn:uuid:%3c4AE0A4BC-4010400@codeware-com%3e</id>
<updated>2009-10-22T18:30:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"&gt;
&lt;/head&gt;
&lt;body bgcolor="#ffffff" text="#000000"&gt;
Does the install-sh script do what you want?&lt;br&gt;
&lt;br&gt;
Moshe Matitya wrote:
&lt;blockquote
 cite="mid:6EA53FAD386F9D46B97D49BFE148D5140606F0BF@ISR-JLM-MAIL1.xconnect.co.il"
 type="cite"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; "&gt;
  &lt;meta name="Generator" content="Microsoft Word 11 (filtered medium)"&gt;
  &lt;o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;
  &lt;o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"&gt;&lt;!--[if !mso]&gt;
&lt;style&gt;
st1\:*{behavior:url(#default#ieooui) }
&lt;/style&gt;
&lt;![endif]--&gt;
  &lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
--&gt;
  &lt;/style&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapedefaults v:ext="edit" spidmax="1026" /&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapelayout v:ext="edit"&gt;
  &lt;o:idmap v:ext="edit" data="1" /&gt;
 &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;
  &lt;/o:SmartTagType&gt;&lt;/o:SmartTagType&gt;
  &lt;div class="Section1"&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;I have been trying,
unsuccessfully, to figure out how to
install log4cxx on Linux with &lt;st1:place w:st="on"&gt;Ant.&lt;/st1:place&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;In the past, when
installing log4cxx 0.9.7 on a Linux
machine, I would build and install it using Make, as follows:&amp;nbsp; To build
it, I would run the following commands:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
autogen.sh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
configure&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
make&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;Then, to install it, I
would simply run:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
make install&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;This would install all
the library files, include files,
etc., in their proper locations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;Now, however, I am using
log4cxx 0.10.0, which I build using
  &lt;st1:place w:st="on"&gt;Ant.&lt;/st1:place&gt;&amp;nbsp; The default target in the Ant
build
script compiles and links the sources, and runs the unit tests.&amp;nbsp;
However,
I don't see how one is supposed to then install it, and I can't find
any
instructions about how to do this in the documentation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;There doesn't seem to be
a target in the Ant build script
called "install", or anything similar.&amp;nbsp; So how does one install
log4cxx when using Ant?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;Thanks,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;st1:PersonName w:st="on"&gt;&lt;font face="Arial"
 size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Moshe Z.
Matitya&lt;/span&gt;&lt;/font&gt;&lt;/st1:PersonName&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;XConnect Global Networks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p class="MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span
 style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Installing log4cxx on Linux with Ant</title>
<author><name>Moshe Matitya &lt;Moshe.Matitya@xconnect.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c6EA53FAD386F9D46B97D49BFE148D5140606F0BF@ISR-JLM-MAIL1.xconnect.co.il%3e"/>
<id>urn:uuid:%3c6EA53FAD386F9D46B97D49BFE148D5140606F0BF@ISR-JLM-MAIL1-xconnect-co-il%3e</id>
<updated>2009-10-22T18:18:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I have been trying, unsuccessfully, to figure out how to install log4cxx on Linux with Ant.

In the past, when installing log4cxx 0.9.7 on a Linux machine, I would build and install it
using Make, as follows:  To build it, I would run the following commands:
            autogen.sh
            configure
            make
Then, to install it, I would simply run:
            make install
This would install all the library files, include files, etc., in their proper locations.

Now, however, I am using log4cxx 0.10.0, which I build using Ant.  The default target in the
Ant build script compiles and links the sources, and runs the unit tests.  However, I don't
see how one is supposed to then install it, and I can't find any instructions about how to
do this in the documentation.

There doesn't seem to be a target in the Ant build script called "install", or anything similar.
 So how does one install log4cxx when using Ant?

Thanks,

Moshe Z. Matitya
XConnect Global Networks



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build fail on AIX using XLC compiler</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c3327549d0910200117l5afc3959g4d977db95765ed4a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0910200117l5afc3959g4d977db95765ed4a@mail-gmail-com%3e</id>
<updated>2009-10-20T08:17:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Experts,

I looked through the simpledateformat.h header file and made the below
change and the build of simpledateformat.cpp passed. It looks like the below
syntax to use the std::locale class causes the problem when enable the
-D_LARGE_FILES compiler flag for AIX XLC.

change the below:
namespace std { class locale; }

to be:
using std::locale;

or to be:
#if LOG4CXX_HAS_STD_LOCALE
#include &lt;locale&gt;
#endif

Then the build of simpledateformat.cpp succeed. Is there some reason to use
the std::locale this way? To support multi-platforms? Or someone could
provide a formal fix based on my change?
 BTW, my building env:
CC = xlc_r
CXX = xlC_r
CFLAGS = -q64 -D_LARGE_FILES -qarch=ppc64 -qsmp
CXXFLAGS= -q64 -D_LARGE_FILES -qarch=ppc64 -qsmp -qpic=large
LDFLAGS = -q64 -qsmp -brtl -bbigtoc

Thanks,
Tom
2009/9/29 Zhou Tao &lt;zhoutao109@gmail.com&gt;

&gt; Hi all,
&gt;
&gt; I am building log4cxx on AIX using XLC as the compiler. And I turn on the
&gt; -D_LARGE_FILES compiler flag for our purpose. However seems that log4cxx
&gt; dislikes the compiler flag. I could build APR, APR-UTIL and when I build
&gt; log4cxx, errors happen when build the simpledateformat.cpp file. The error
&gt; message is the following,
&gt;
&gt; /bin/sh ../../../libtool --tag=CXX --mode=compile /usr/vacpp/bin/xlC_r
&gt; -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
&gt; -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
&gt; -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
&gt; -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
&gt; -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
&gt; -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1 -DHAVE_SYSLOG=1
&gt; -DHAVE_FWIDE=1  -I. -I. -I../../../src/main/include
&gt; -I../../../src/main/include  -I/usr/vacpp/include  -U__STR__ -D_THREAD_SAFE
&gt; -D_USE_IRS
&gt; -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
&gt; -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
&gt; -q64 -D_LARGE_FILES -qlonglong -c -o simpledateformat.lo
&gt; simpledateformat.cpp
&gt;  /usr/vacpp/bin/xlC_r -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
&gt; -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
&gt; -DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1
&gt; -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
&gt; -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
&gt; -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1
&gt; -DHAVE_SYSLOG=1 -DHAVE_FWIDE=1 -I. -I. -I../../../src/main/include
&gt; -I../../../src/main/include -I/usr/vacpp/include -U__STR__ -D_THREAD_SAFE
&gt; -D_USE_IRS
&gt; -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
&gt; -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
&gt; -q64 -D_LARGE_FILES -qlonglong -c -M simpledateformat.cpp  -DPIC -o
&gt; .libs/simpledateformat.o
&gt; "simpledateformat.cpp", line 735.15: 1540-1118 (S) The declaration of
&gt; "defaultLocale" uses the undefined class "std::locale" when the class must
&gt; be complete.
&gt; "simpledateformat.cpp", line 124.25: 1540-0218 (S) The call does not match
&gt; any parameter list for
&gt; "std::has_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt; &gt;".
&gt; "/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
&gt; "std::_LFS_ON::has_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
&gt; "simpledateformat.cpp", line 124.35: 1540-0256 (I) A parameter of type
&gt; "const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
&gt; type "const std::locale".
&gt; "simpledateformat.cpp", line 125.63: 1540-0218 (S) The call does not match
&gt; any parameter list for
&gt; "std::use_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt; &gt;".
&gt; "/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
&gt; "std::_LFS_ON::use_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
&gt; "simpledateformat.cpp", line 125.73: 1540-0256 (I) A parameter of type
&gt; "const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
&gt; type "const std::locale".
&gt; "simpledateformat.cpp", line 136.25: 1540-0218 (S) The call does not match
&gt; any parameter list for
&gt; "std::has_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt; &gt;".
&gt; "/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
&gt; "std::_LFS_ON::has_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
&gt; "simpledateformat.cpp", line 136.35: 1540-0256 (I) A parameter of type
&gt; "const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
&gt; type "const std::locale".
&gt; "simpledateformat.cpp", line 137.60: 1540-0218 (S) The call does not match
&gt; any parameter list for
&gt; "std::use_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt; &gt;".
&gt; "/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
&gt; "std::_LFS_ON::use_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
&gt; "simpledateformat.cpp", line 137.70: 1540-0256 (I) A parameter of type
&gt; "const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
&gt; type "const std::locale".
&gt; make[3]: *** [simpledateformat.lo] Error 1
&gt;
&gt; Any insight for this issue is greatly appreciated.
&gt; Tom
&gt;



-- 
Thanks and Regards,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to clean up the log4cxx objects to avoid the memory leak?</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-user/200910.mbox/%3c5d5d09c0910140355m4d98113bja2b115784cc113b6@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0910140355m4d98113bja2b115784cc113b6@mail-gmail-com%3e</id>
<updated>2009-10-14T10:55:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Tom,    You dont need to reclaim the memory, smart pointer will do it
automatically once it goes out of scope.

   LoggerPtr is a typedef for helpers::ObjectPtrT&lt;Logger&gt;. The class
  ObjectPtr is a Smart Pointer pattern implementation, which uses the
  helper class ObjectImpl. This class uses apr_atomic_inc32 and
  apr_atomic_dec32 to count the references to itself. If the reference
  count is 0, it deletes itself.

   You can validate it by running any memory profiler on your code.
Thanks
Deepak

On Wed, Oct 14, 2009 at 1:50 PM, Zhou Tao &lt;zhoutao109@gmail.com&gt; wrote:

&gt; Thanks, Deepak
&gt;
&gt; So if want to close one created looger and release its releated resources,
&gt; what should I do? using smart pointer, I don't need to delete the objects.
&gt; But How can I release the resources? Do I need to call the below API to
&gt; release the resources?
&gt;
&gt; //close the appender
&gt; _appenderPtr-&gt;close();
&gt;
&gt; //close all appenders associated with the logger
&gt; _loggerPtr-&gt;closeNestedAppenders();
&gt; _loggerPtr-&gt;removeAllAppenders();
&gt;
&gt; Or some other APIs I need to call to release all resources to avoid memory
&gt; leak?
&gt;
&gt; Thank you.
&gt; 2009/10/14 deepak singh &lt;deepak.iitg@gmail.com&gt;
&gt;
&gt; You should use smart pointer instead.
&gt;&gt; e.g
&gt;&gt;
&gt;&gt;     log4cxx::LogManager::resetConfiguration();
&gt;&gt;
&gt;&gt;    log4cxx::LayoutPtr layoutPtr(new log4cxx::PatternLayout("%c-%p (%d{dd MMM yyyy
HH:mm:ss}) [%-5t] %m%n"));
&gt;&gt;    log4cxx::AppenderPtr appenderPtr( new log4cxx::ConsoleAppender(layoutPtr, "System.err"));
&gt;&gt;    log4cxx::BasicConfigurator::configure(appenderPtr);
&gt;&gt;
&gt;&gt;
&gt;&gt; Thanks
&gt;&gt; Deepak
&gt;&gt;
&gt;&gt;
&gt;&gt; On Wed, Oct 14, 2009 at 8:41 AM, Zhou Tao &lt;zhoutao109@gmail.com&gt; wrote:
&gt;&gt;
&gt;&gt;&gt; Experts,
&gt;&gt;&gt;
&gt;&gt;&gt; I am using the log4cxx-0.10.0. And at the begining of the application, I
&gt;&gt;&gt; create the log4cxx instances including Logger, FileAppender, PatternLayout
&gt;&gt;&gt; etc. Sometime within the application, I need to destroy the instances.
&gt;&gt;&gt; For example,
&gt;&gt;&gt; To create the below objects at the begining,
&gt;&gt;&gt;
&gt;&gt;&gt; _layout = new log4cxx::PatternLayout(format);
&gt;&gt;&gt; _fileAppender = new log4cxx::RollingFileAppender();
&gt;&gt;&gt; ....
&gt;&gt;&gt;
&gt;&gt;&gt; Then somewhere to remove the above objects like the below,
&gt;&gt;&gt;
&gt;&gt;&gt; delete _fileAppender;
&gt;&gt;&gt; delete _layout;
&gt;&gt;&gt; ....
&gt;&gt;&gt;
&gt;&gt;&gt; However when deleting the objects, always core dump on windows. On unix,
&gt;&gt;&gt; when the application exit, also get a core dump.
&gt;&gt;&gt; Then how to clean up the log4cxx instances or a sequence is required when
&gt;&gt;&gt; deleting the objects? or some example code?
&gt;&gt;&gt;
&gt;&gt;&gt; Any suggestion are highly appreciated.
&gt;&gt;&gt; Thanks,
&gt;&gt;&gt; Tom
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to clean up the log4cxx objects to avoid the memory leak?</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c3327549d0910140120i32ef8148ne2532bc5e9176181@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0910140120i32ef8148ne2532bc5e9176181@mail-gmail-com%3e</id>
<updated>2009-10-14T08:20:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks, Deepak

So if want to close one created looger and release its releated resources,
what should I do? using smart pointer, I don't need to delete the objects.
But How can I release the resources? Do I need to call the below API to
release the resources?

//close the appender
_appenderPtr-&gt;close();

//close all appenders associated with the logger
_loggerPtr-&gt;closeNestedAppenders();
_loggerPtr-&gt;removeAllAppenders();

Or some other APIs I need to call to release all resources to avoid memory
leak?

Thank you.
2009/10/14 deepak singh &lt;deepak.iitg@gmail.com&gt;

&gt; You should use smart pointer instead.
&gt; e.g
&gt;
&gt;     log4cxx::LogManager::resetConfiguration();
&gt;    log4cxx::LayoutPtr layoutPtr(new log4cxx::PatternLayout("%c-%p (%d{dd MMM yyyy HH:mm:ss})
[%-5t] %m%n"));
&gt;    log4cxx::AppenderPtr appenderPtr( new log4cxx::ConsoleAppender(layoutPtr, "System.err"));
&gt;    log4cxx::BasicConfigurator::configure(appenderPtr);
&gt;
&gt; Thanks
&gt; Deepak
&gt;
&gt;
&gt; On Wed, Oct 14, 2009 at 8:41 AM, Zhou Tao &lt;zhoutao109@gmail.com&gt; wrote:
&gt;
&gt;&gt; Experts,
&gt;&gt;
&gt;&gt; I am using the log4cxx-0.10.0. And at the begining of the application, I
&gt;&gt; create the log4cxx instances including Logger, FileAppender, PatternLayout
&gt;&gt; etc. Sometime within the application, I need to destroy the instances.
&gt;&gt; For example,
&gt;&gt; To create the below objects at the begining,
&gt;&gt;
&gt;&gt; _layout = new log4cxx::PatternLayout(format);
&gt;&gt; _fileAppender = new log4cxx::RollingFileAppender();
&gt;&gt; ....
&gt;&gt;
&gt;&gt; Then somewhere to remove the above objects like the below,
&gt;&gt;
&gt;&gt; delete _fileAppender;
&gt;&gt; delete _layout;
&gt;&gt; ....
&gt;&gt;
&gt;&gt; However when deleting the objects, always core dump on windows. On unix,
&gt;&gt; when the application exit, also get a core dump.
&gt;&gt; Then how to clean up the log4cxx instances or a sequence is required when
&gt;&gt; deleting the objects? or some example code?
&gt;&gt;
&gt;&gt; Any suggestion are highly appreciated.
&gt;&gt; Thanks,
&gt;&gt; Tom
&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: How to clean up the log4cxx objects to avoid the memory leak?</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-user/200910.mbox/%3c5d5d09c0910132220t2d096728s9d251fde6167f764@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5d5d09c0910132220t2d096728s9d251fde6167f764@mail-gmail-com%3e</id>
<updated>2009-10-14T05:20:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
You should use smart pointer instead.
e.g

    log4cxx::LogManager::resetConfiguration();
   log4cxx::LayoutPtr layoutPtr(new log4cxx::PatternLayout("%c-%p
(%d{dd MMM yyyy HH:mm:ss}) [%-5t] %m%n"));
   log4cxx::AppenderPtr appenderPtr( new
log4cxx::ConsoleAppender(layoutPtr, "System.err"));
   log4cxx::BasicConfigurator::configure(appenderPtr);

Thanks
Deepak

On Wed, Oct 14, 2009 at 8:41 AM, Zhou Tao &lt;zhoutao109@gmail.com&gt; wrote:

&gt; Experts,
&gt;
&gt; I am using the log4cxx-0.10.0. And at the begining of the application, I
&gt; create the log4cxx instances including Logger, FileAppender, PatternLayout
&gt; etc. Sometime within the application, I need to destroy the instances.
&gt; For example,
&gt; To create the below objects at the begining,
&gt;
&gt; _layout = new log4cxx::PatternLayout(format);
&gt; _fileAppender = new log4cxx::RollingFileAppender();
&gt; ....
&gt;
&gt; Then somewhere to remove the above objects like the below,
&gt;
&gt; delete _fileAppender;
&gt; delete _layout;
&gt; ....
&gt;
&gt; However when deleting the objects, always core dump on windows. On unix,
&gt; when the application exit, also get a core dump.
&gt; Then how to clean up the log4cxx instances or a sequence is required when
&gt; deleting the objects? or some example code?
&gt;
&gt; Any suggestion are highly appreciated.
&gt; Thanks,
&gt; Tom
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>How to clean up the log4cxx objects to avoid the memory leak?</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200910.mbox/%3c3327549d0910132011o3744f76if662ed26d53ac0eb@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0910132011o3744f76if662ed26d53ac0eb@mail-gmail-com%3e</id>
<updated>2009-10-14T03:11:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Experts,

I am using the log4cxx-0.10.0. And at the begining of the application, I
create the log4cxx instances including Logger, FileAppender, PatternLayout
etc. Sometime within the application, I need to destroy the instances.
For example,
To create the below objects at the begining,

_layout = new log4cxx::PatternLayout(format);
_fileAppender = new log4cxx::RollingFileAppender();
....

Then somewhere to remove the above objects like the below,

delete _fileAppender;
delete _layout;
....

However when deleting the objects, always core dump on windows. On unix,
when the application exit, also get a core dump.
Then how to clean up the log4cxx instances or a sequence is required when
deleting the objects? or some example code?

Any suggestion are highly appreciated.
Thanks,
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>Build fail on AIX using XLC compiler</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c3327549d0909291836v7d8a962dncfaedb91287a38c4@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0909291836v7d8a962dncfaedb91287a38c4@mail-gmail-com%3e</id>
<updated>2009-09-30T01:36:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

I am building log4cxx on AIX using XLC as the compiler. And I turn on the
-D_LARGE_FILES compiler flag for our purpose. However seems that log4cxx
dislikes the compiler flag. I could build APR, APR-UTIL and when I build
log4cxx, errors happen when build the simpledateformat.cpp file. The error
message is the following,

/bin/sh ../../../libtool --tag=CXX --mode=compile /usr/vacpp/bin/xlC_r
-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
-DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1 -DHAVE_SYSLOG=1
-DHAVE_FWIDE=1  -I. -I. -I../../../src/main/include
-I../../../src/main/include  -I/usr/vacpp/include  -U__STR__ -D_THREAD_SAFE
-D_USE_IRS
-I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
-I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
-q64 -D_LARGE_FILES -qlonglong -c -o simpledateformat.lo
simpledateformat.cpp
 /usr/vacpp/bin/xlC_r -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
-DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
-DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1
-DHAVE_SYSLOG=1 -DHAVE_FWIDE=1 -I. -I. -I../../../src/main/include
-I../../../src/main/include -I/usr/vacpp/include -U__STR__ -D_THREAD_SAFE
-D_USE_IRS
-I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
-I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
-q64 -D_LARGE_FILES -qlonglong -c -M simpledateformat.cpp  -DPIC -o
.libs/simpledateformat.o
"simpledateformat.cpp", line 735.15: 1540-1118 (S) The declaration of
"defaultLocale" uses the undefined class "std::locale" when the class must
be complete.
"simpledateformat.cpp", line 124.25: 1540-0218 (S) The call does not match
any parameter list for
"std::has_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt;".
"/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
"std::_LFS_ON::has_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
"simpledateformat.cpp", line 124.35: 1540-0256 (I) A parameter of type
"const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
type "const std::locale".
"simpledateformat.cpp", line 125.63: 1540-0218 (S) The call does not match
any parameter list for
"std::use_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt;".
"/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
"std::_LFS_ON::use_facet&lt;std::_LFS_ON::time_put&lt;wchar_t,std::ostreambuf_iterator&lt;wchar_t,std::char_traits&lt;wchar_t&gt;
&gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
"simpledateformat.cpp", line 125.73: 1540-0256 (I) A parameter of type
"const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
type "const std::locale".
"simpledateformat.cpp", line 136.25: 1540-0218 (S) The call does not match
any parameter list for
"std::has_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt;".
"/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
"std::_LFS_ON::has_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
"simpledateformat.cpp", line 136.35: 1540-0256 (I) A parameter of type
"const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
type "const std::locale".
"simpledateformat.cpp", line 137.60: 1540-0218 (S) The call does not match
any parameter list for
"std::use_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt;".
"/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
"std::_LFS_ON::use_facet&lt;std::_LFS_ON::time_put&lt;char,std::ostreambuf_iterator&lt;char,std::char_traits&lt;char&gt;
&gt; &gt; &gt;(const locale &amp;)" is not a viable candidate.
"simpledateformat.cpp", line 137.70: 1540-0256 (I) A parameter of type
"const std::_LFS_ON::locale &amp;" cannot be initialized with an expression of
type "const std::locale".
make[3]: *** [simpledateformat.lo] Error 1

Any insight for this issue is greatly appreciated.
Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: log4cxx with JNI... Crashes when using appender and layout?</title>
<author><name>&quot;Zmuda, Matthew&quot; &lt;Matthew_Zmuda@tvworks.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EB7@ldn-mx1.ad.liberate.com%3e"/>
<id>urn:uuid:%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EB7@ldn-mx1-ad-liberate-com%3e</id>
<updated>2009-09-25T13:33:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Fixed.

Was a problem with the built libraries I was using.

I simply rebuilt the project and now work! 

 

Matt Zmuda

Software Developer - Tools Group

________________________________

From: Zmuda, Matthew [mailto:Matthew_Zmuda@tvworks.com] 
Sent: September 25, 2009 8:20 AM
To: Log4CXX User
Subject: RE: log4cxx with JNI... Crashes when using appender and layout?

 

I wanted to add to this issue.

I noticed the error only occurs once the app finishes running, so probably when the DLL is
unloading and there is some cleaning occurring.

Should I be doing any cleanup from the below code? I didn't look into it much yet but it seems
that all the XxxxxPtr classes are smart pointers?

And from examples I've seen there has been no cleanup.

 

Thanks,

 

Matt Zmuda

Software Developer - Tools Group

________________________________

From: Zmuda, Matthew [mailto:Matthew_Zmuda@tvworks.com] 
Sent: September 24, 2009 5:38 PM
To: log4cxx-user@logging.apache.org
Subject: log4cxx with JNI... Crashes when using appender and layout?

 

When calling native code from java the following works when making the native calls:

    BasicConfigurator::configure();

    LoggerPtr rootLogger = Logger::getRootLogger();

    LOG4CXX_DEBUG(rootLogger, "debug message");

    LOG4CXX_INFO(rootLogger, "info message");

    LOG4CXX_WARN(rootLogger, "warn message");

    LOG4CXX_ERROR(rootLogger, "error message");

    LOG4CXX_FATAL(rootLogger, "fatal message");

If I try setting appender and layout like:

    LoggerPtr rootLogger = Logger::getRootLogger();

        log4cxx::ConsoleAppenderPtr appender(new log4cxx::ConsoleAppender());

        log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout());

    appender-&gt;setLayout(layout);

        log4cxx::helpers::Pool pool;

    appender-&gt;activateOptions(pool);

        rootLogger-&gt;addAppender(appender);

        LogManager::getLoggerRepository()-&gt;setConfigured(true);

    LOG4CXX_DEBUG(rootLogger, "debug message");

    LOG4CXX_INFO(rootLogger, "info message");

    LOG4CXX_WARN(rootLogger, "warn message");

    LOG4CXX_ERROR(rootLogger, "error message");

    LOG4CXX_FATAL(rootLogger, "fatal message");

I get memory could not be "written" Application error and JVM crashes.  The messages show
up in proper format and all but after that what I get.

Any ideas?

Matt Zmuda

Software Developer - Tools Group

TVWorks - Platform Division, London, Canada

(519) 963-4304



</pre>
</div>
</content>
</entry>
<entry>
<title>RE: Are log4j and log4cxx configuration files identical?</title>
<author><name>&quot;Zmuda, Matthew&quot; &lt;Matthew_Zmuda@tvworks.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EB1@ldn-mx1.ad.liberate.com%3e"/>
<id>urn:uuid:%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EB1@ldn-mx1-ad-liberate-com%3e</id>
<updated>2009-09-25T12:24:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks for this!

Matt Zmuda
Software Developer - Tools Group

-----Original Message-----
From: log4cxx [mailto:log4cxx@gallandfamily.com] 
Sent: September 25, 2009 8:16 AM
To: Log4CXX User
Subject: Re: Are log4j and log4cxx configuration files identical?

&gt;I am coding a JNI project and planning to use log4j in java portion and log4cxx in c++.

&gt;Can the same configurations files be used for both?
The formats are the same, but because of the answer to your third question, you may need two
different files unless you add appenders
programmatically, or split your loggers such that C++ loggers go to one appender and Java
loggers go to another.

&gt;If I change logging level at runtime in Java will the changes also be made in c++ logger?
If you are making the changes in Java, they will not have any affect on the log4cxx logging
configuration. If you are making changes to the file, and
you have both your Java initialization and C++ initialization both set up to configure and
watch, then both should see the file change and reconfigure
based on the new file settings.

&gt;Finally can both Java and C++ loggers log to the same file?
Both Java and C++ will try to open the file with write permissions, so this will not work.

-Andy


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: log4cxx with JNI... Crashes when using appender and layout?</title>
<author><name>&quot;Zmuda, Matthew&quot; &lt;Matthew_Zmuda@tvworks.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAF@ldn-mx1.ad.liberate.com%3e"/>
<id>urn:uuid:%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAF@ldn-mx1-ad-liberate-com%3e</id>
<updated>2009-09-25T12:20:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I wanted to add to this issue.

I noticed the error only occurs once the app finishes running, so probably when the DLL is
unloading and there is some cleaning occurring.

Should I be doing any cleanup from the below code? I didn't look into it much yet but it seems
that all the XxxxxPtr classes are smart pointers?

And from examples I've seen there has been no cleanup.

 

Thanks,

 

Matt Zmuda

Software Developer - Tools Group

________________________________

From: Zmuda, Matthew [mailto:Matthew_Zmuda@tvworks.com] 
Sent: September 24, 2009 5:38 PM
To: log4cxx-user@logging.apache.org
Subject: log4cxx with JNI... Crashes when using appender and layout?

 

When calling native code from java the following works when making the native calls:

    BasicConfigurator::configure();

    LoggerPtr rootLogger = Logger::getRootLogger();

    LOG4CXX_DEBUG(rootLogger, "debug message");

    LOG4CXX_INFO(rootLogger, "info message");

    LOG4CXX_WARN(rootLogger, "warn message");

    LOG4CXX_ERROR(rootLogger, "error message");

    LOG4CXX_FATAL(rootLogger, "fatal message");

If I try setting appender and layout like:

    LoggerPtr rootLogger = Logger::getRootLogger();

        log4cxx::ConsoleAppenderPtr appender(new log4cxx::ConsoleAppender());

        log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout());

    appender-&gt;setLayout(layout);

        log4cxx::helpers::Pool pool;

    appender-&gt;activateOptions(pool);

        rootLogger-&gt;addAppender(appender);

        LogManager::getLoggerRepository()-&gt;setConfigured(true);

    LOG4CXX_DEBUG(rootLogger, "debug message");

    LOG4CXX_INFO(rootLogger, "info message");

    LOG4CXX_WARN(rootLogger, "warn message");

    LOG4CXX_ERROR(rootLogger, "error message");

    LOG4CXX_FATAL(rootLogger, "fatal message");

I get memory could not be "written" Application error and JVM crashes.  The messages show
up in proper format and all but after that what I get.

Any ideas?

Matt Zmuda

Software Developer - Tools Group

TVWorks - Platform Division, London, Canada

(519) 963-4304



</pre>
</div>
</content>
</entry>
<entry>
<title>=?iso-8859-1?B?UmU6IEFyZSBsb2c0aiBhbmQgbG9nNGN4eCBjb25maWd1cmF0aW9uIGZpbGVzIGlkZW50aWNhbD8=?=</title>
<author><name>&quot;=?iso-8859-1?Q?log4cxx?=&quot; &lt;log4cxx@gallandfamily.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c20090925121602.31060.qmail@hoster908.com%3e"/>
<id>urn:uuid:%3c20090925121602-31060-qmail@hoster908-com%3e</id>
<updated>2009-09-25T12:16:02Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt;I am coding a JNI project and planning to use log4j in java portion and log4cxx in c++.

&gt;Can the same configurations files be used for both?
The formats are the same, but because of the answer to your third question, you may need two
different files unless you add appenders programmatically, or split your loggers such that
C++ loggers go to one appender and Java loggers go to another.

&gt;If I change logging level at runtime in Java will the changes also be made in c++ logger?
If you are making the changes in Java, they will not have any affect on the log4cxx logging
configuration. If you are making changes to the file, and you have both your Java initialization
and C++ initialization both set up to configure and watch, then both should see the file change
and reconfigure based on the new file settings.

&gt;Finally can both Java and C++ loggers log to the same file?
Both Java and C++ will try to open the file with write permissions, so this will not work.

-Andy


</pre>
</div>
</content>
</entry>
<entry>
<title>log4cxx with JNI... Crashes when using appender and layout?</title>
<author><name>&quot;Zmuda, Matthew&quot; &lt;Matthew_Zmuda@tvworks.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAE@ldn-mx1.ad.liberate.com%3e"/>
<id>urn:uuid:%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAE@ldn-mx1-ad-liberate-com%3e</id>
<updated>2009-09-24T21:38:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
When calling native code from java the following works when making the native calls:

    BasicConfigurator::configure();
    LoggerPtr rootLogger = Logger::getRootLogger();

    LOG4CXX_DEBUG(rootLogger, "debug message");
    LOG4CXX_INFO(rootLogger, "info message");
    LOG4CXX_WARN(rootLogger, "warn message");
    LOG4CXX_ERROR(rootLogger, "error message");
    LOG4CXX_FATAL(rootLogger, "fatal message");


If I try setting appender and layout like:

    LoggerPtr rootLogger = Logger::getRootLogger();

	log4cxx::ConsoleAppenderPtr appender(new log4cxx::ConsoleAppender());
	log4cxx::LayoutPtr layout(new log4cxx::SimpleLayout());
    appender-&gt;setLayout(layout);
	log4cxx::helpers::Pool pool;
    appender-&gt;activateOptions(pool);
	rootLogger-&gt;addAppender(appender);
	LogManager::getLoggerRepository()-&gt;setConfigured(true);

    LOG4CXX_DEBUG(rootLogger, "debug message");
    LOG4CXX_INFO(rootLogger, "info message");
    LOG4CXX_WARN(rootLogger, "warn message");
    LOG4CXX_ERROR(rootLogger, "error message");
    LOG4CXX_FATAL(rootLogger, "fatal message");

I get memory could not be "written" Application error and JVM crashes.  The messages show
up in proper format and all but after that what I get.



Any ideas?

Matt Zmuda
Software Developer - Tools Group
TVWorks - Platform Division, London, Canada
(519) 963-4304



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Are log4j and log4cxx configuration files identical?</title>
<author><name>Vasile.Jureschi@sophia.inria.fr</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c200909242351.32800.vjuresch@sophia.inria.fr%3e"/>
<id>urn:uuid:%3c200909242351-32800-vjuresch@sophia-inria-fr%3e</id>
<updated>2009-09-24T20:51:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Thursday 24 September 2009 17:57:39 Zmuda, Matthew wrote:
&gt; I am coding a JNI project and planning to use log4j in java portion and
&gt;  log4cxx in c++. Can the same configurations files be used for both?
&gt; 

The same configuration file format is used for both but probably you will have 
different class names for C++ and Java. So you will need to define loggers depending
on the class, package etc. Probably you can define a naming scheme for classes so 
the loggers apply to both parts. 
 
&gt; If I change logging level at runtime in Java will the changes also be made
&gt;  in c++ logger?

See above

&gt; Finally can both Java and C++ loggers log to the same file?
Yes I thinks so, by defining appenders that log to the same file. 

Scroll down for appenders
http://logging.apache.org/log4cxx/index.html
http://logging.apache.org/log4j/1.2/manual.html

Attached is a file I'm using for logging, I think it's self explanatory.
&gt; 
&gt; Thanks,
&gt; 
&gt; Matt Zmuda
&gt; Software Developer - Tools Group
&gt; TVWorks - Platform Division, London, Canada
&gt; (519) 963-4304
&gt; 




</pre>
</div>
</content>
</entry>
<entry>
<title>Are log4j and log4cxx configuration files identical?</title>
<author><name>&quot;Zmuda, Matthew&quot; &lt;Matthew_Zmuda@tvworks.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAC@ldn-mx1.ad.liberate.com%3e"/>
<id>urn:uuid:%3cBECCBEF0A2DF554084845C3E3C70D3A57A1EAC@ldn-mx1-ad-liberate-com%3e</id>
<updated>2009-09-24T14:57:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am coding a JNI project and planning to use log4j in java portion and log4cxx in c++. Can
the same configurations files be used for both?

If I change logging level at runtime in Java will the changes also be made in c++ logger?

Finally can both Java and C++ loggers log to the same file?

Thanks,

Matt Zmuda
Software Developer - Tools Group
TVWorks - Platform Division, London, Canada
(519) 963-4304



</pre>
</div>
</content>
</entry>
<entry>
<title>log4cxx make segment fault on the program exits.</title>
<author><name>Liu bbskill &lt;bbskill@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c9c8372c20909180947m3d933a88n90882e1c5792af20@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9c8372c20909180947m3d933a88n90882e1c5792af20@mail-gmail-com%3e</id>
<updated>2009-09-18T16:47:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
hi,
I run the example of log4cxx on the apache site.
// include log4cxx header files.
#include "log4cxx/logger.h"
#include "log4cxx/basicconfigurator.h"
#include "log4cxx/helpers/exception.h"

using namespace log4cxx;
using namespace log4cxx::helpers;

LoggerPtr logger(Logger::getLogger("MyApp"));

int main(int argc, char **argv)
{
        int result = EXIT_SUCCESS;
        try
        {
                // Set up a simple configuration that logs on the console.
                BasicConfigurator::configure();

                LOG4CXX_INFO(logger, "Entering application.");
                LOG4CXX_INFO(logger, "Exiting application.");
        }
        catch(Exception&amp;)
        {
                result = EXIT_FAILURE;
        }

        return result;
}

But when I run it, I got segement fault error when the program exits. But it
works fine when "LoggerPtr logger(Logger::getLogger("MyApp"));" is inside
the main function.

More ever, When I declare a static LoggerPtr in a A.h as its memeber, and
initialize it in the A.cpp using
in the A.h
private:

static log4cxx::LoggerPtr;

in the A.cpp
logger = log4cxx::Logger::getLogger("A");

It also will a segement fault error when the program exits.

It make me crazy.  I almost can't use it.

Could anyone help me solve it ??

Thank you very much.


-- 
JinBiao Liu


</pre>
</div>
</content>
</entry>
<entry>
<title>Log4cxx is getting crashed if the Syslog's port 514 is blocked by firewall</title>
<author><name>Shyam Pabbathi &lt;spabbath@Brocade.COM&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c0D25897904851D4FB37F41F8867B84AF2D45023611@HQ-EXCH-7.corp.brocade.com%3e"/>
<id>urn:uuid:%3c0D25897904851D4FB37F41F8867B84AF2D45023611@HQ-EXCH-7-corp-brocade-com%3e</id>
<updated>2009-09-03T21:16:56Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

My application is getting crashed with SIGABRT on Vmware (Esx 3.5 &amp; Esx 4) when it sends
the event to Syslog host (using UDP Port# 514). But, syslog port 514 is blocked by Esx Firewall
by default. I added try &amp; catch block to LOG4CXX_INFO(loggerSyslog, syslogBuf) macro and
it didn't help.

The Application runs very well if Syslog's port 514 is open by firewall.

Is there any way to avoid the application crash even if syslog's port 514 blocked by firewall?
I would like to avoid checking the firewall status on Syslog's port 514 each time before I
send the event to Syslog host.

Here are the versions I use:
apache-log4cxx-0.10.0
apr-1.2.12
apr-util-1.2.12

As per the stack trace of core file:

The application throws IO Exception at:

// send the datagram packet
   apr_size_t len = p-&gt;getLength();
   status = apr_socket_sendto(socket, addr, 0,
                              (char *)p-&gt;getData(), &amp;len);
   if (status != APR_SUCCESS) {
     throw IOException(status);

Here is the stack trace of core dump:

terminate called after throwing an instance of 'log4cxx::helpers::IOException'
  what():  IO Exception : status code = 1
Unable to get event information. status: 1Unable to get event information. status: 1
Program received signal SIGABRT, Aborted.
[Switching to Thread -134305552 (LWP 23857)]
0x009b77f2 in _dl_sysinfo_int80 ()
    at ../../../src/main/include/log4cxx/helpers/objectptr.h:100
100     ../../../src/main/include/log4cxx/helpers/objectptr.h: No such file or directory.
        in ../../../src/main/include/log4cxx/helpers/objectptr.h
(gdb) where
#0  0x009b77f2 in _dl_sysinfo_int80 ()
    at ../../../src/main/include/log4cxx/helpers/objectptr.h:100
#1  0x009fdd10 in raise ()
    at ../../../src/main/include/log4cxx/helpers/objectptr.h:100
#2  0x009ff621 in abort ()
    at ../../../src/main/include/log4cxx/helpers/objectptr.h:100
#3  0x083a95e0 in __gnu_cxx::__verbose_terminate_handler ()
#4  0x083a6935 in __cxxabiv1::__terminate ()
#5  0x083a6972 in std::terminate ()
#6  0x083a687a in __cxa_throw ()
#7  0x0819ce82 in log4cxx::helpers::DatagramSocket::send (this=0xc19e830,
    p=@0xffaaf274) at datagramsocket.cpp:184
#8  0x08188c67 in log4cxx::helpers::SyslogWriter::write (this=0xc19e898,
    source=@0xffaaf2c0) at syslogwriter.cpp:66
#9  0x08186f74 in log4cxx::net::SyslogAppender::append (this=0xc19e0c8,
    event=@0xffaaf3e4, p=@0xffaaf3ec) at syslogappender.cpp:296
#10 0x081367d7 in log4cxx::AppenderSkeleton::doAppend (this=0xc19e0c8,
    event=@0xffaaf3e4, pool1=@0xffaaf3ec) at appenderskeleton.cpp:142
#11 0x08133c19 in log4cxx::helpers::AppenderAttachableImpl::appendLoopOnAppenders (this=0xc19dea0,
event=@0xffaaf3e4, p=@0xffaaf3ec)
    at appenderattachableimpl.cpp:69
#12 0x0810e7c3 in log4cxx::Logger::callAppenders (this=0xc17c9c8,
    event=@0xffaaf3e4, p=@0xffaaf3ec) at logger.cpp:93
#13 0x0810ee5a in log4cxx::Logger::forcedLog (this=0xc17c9c8,
    level1=@0xffaafed4, message=@0xffaafdd4, location=@0xffaafec8)
    at logger.cpp:124
#14 0x081e9e16 in hba_eventBufferUpdate (eventCategory=4, eventId=1,
    eventSeverity=4, eventTime=1251874231,
    portWWN=0xffab014c "10:00:00:05:1E:53:08:A5",
    eventMsg=0xffaaff9c "Remote port (WWN = 10:00:00:05:1E:53:08:A4) online for logical port
(WWN = 10:00:00:05:1E:53:08:A5).", eventData=0xffab0204 "",
    eventDataSize=40) at AgtLibEvent.cpp:272
#15 0x081ed734 in hba_RPortEventCallback (user_data=0x0,
    event=BFA_RPORT_AEN_ONLINE, data=0xffab0204, tv=
      {tv_sec = 1251874161, tv_usec = 965034}) at AgtLibEvent.cpp:750
#16 0x081ef49f in hba_getOldEvents () at AgtLibEvent.cpp:1597
#17 0x081efcd2 in hba_registerForEvents () at AgtLibEvent.cpp:1653
#18 0x081fb1cb in agent_bfal_init () at AgtLibInit.cpp:599
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
#19 0x081fc2b5 in init_hba_lib () at AgtLibInit.cpp:642
#20 0x08066649 in MethodRegistration::registerMethods ()
    at MethodRegistration.cpp:21
#21 0x080639cd in JsonRpcManager::instance () at JsonRpcManager.cpp:20
#22 0x08058aaa in hba_api_init () at extension.cpp:60
#23 0x08058f3d in CUnixAgent::run (this=0xffac3cec, srv=0xffac3c70,
    as_daemon=false) at unixAgent.cpp:124
#24 0x08056df5 in main (argc=1, argv=0xffac3db8) at main.cpp:288
(gdb)

Thanks,
-- Shyam



</pre>
</div>
</content>
</entry>
<entry>
<title>How to build a x64 library on windows with Visual Studio?</title>
<author><name>Zhou Tao &lt;zhoutao109@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200909.mbox/%3c3327549d0909030834ld127a6m56dbe5d7accb2428@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3327549d0909030834ld127a6m56dbe5d7accb2428@mail-gmail-com%3e</id>
<updated>2009-09-03T15:34:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

I am trying to build the log4cxx libraries on a Windows x64 2003 server. I
use a Visual Studio 2005 as the compiling tool.

I can build the APR, APR-UTIL with x64 option, however for log4cxx.dsp the
x64 option in Visual Studio 2005 is disabled.

So how to use or build the log4cxx on a winx64 server.

Thanks tons,

Tom


</pre>
</div>
</content>
</entry>
<entry>
<title>RE: efficiencies of getLogger()</title>
<author><name>david.weber@l-3com.com</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/200908.mbox/%3c55B858CA6C995345AF972EF652665FB706B9EA0E@ARLEXCHVS01.lst.link.l-3com.com%3e"/>
<id>urn:uuid:%3c55B858CA6C995345AF972EF652665FB706B9EA0E@ARLEXCHVS01-lst-link-l-3com-com%3e</id>
<updated>2009-08-31T23:15:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Sorry for the late reply

I had to think about it for a bit, but I finally remembered.

We had a single class instance, which could represent a variety of
things.  They were assembled based on a data file. (Think of lego
bricks, where the bricks are C++ classes)

Each class when created, had a fully qualified textual name to describe
what they are representing.  Due to the scope and great number of things
being created, we wanted to log based on the FQN.  For instance:

Class Name: "Foo"
FQN1:  "A.B.C"
FQN2:  "D.E.F"

Class Foo, could be assembled to represent A.B.C or D.E.F.  You could
only create A.B.C once, or 100 times.  So, we couldn't create a static
logger, but we could make a getLogger() call which would cache the
logger once it was created.

I seem to recall reading that there was a caching functionality within
getLogger() itself, but by simply putting in code similar to:


std::map&lt;std::string, LoggerPtr&gt; loggerCache;

LoggerPtr getLogger2(std::string name)
{
	if (loggerCache.find(name) != loggerCache.end())
	{
		return loggerCache[name];
	}
	else
	{
		LoggerPtr lp = getLogger(name);
		loggerCache[name] = lp;
		return lp;
	}
}

(I call the above pseudo code, because I always forget the stl map find
syntax, and I'm too lazy to look it up :D )

Maybe something to add to the next version of log4cxx?


-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Tuesday, August 18, 2009 11:03 PM
To: Log4CXX User
Subject: Re: efficiencies of getLogger()

The typical pattern is to use a static logger member in a class which
results in getLogger() being called once per class during
initialization:

foo.h

class Foo {
    statlc log4cxx::LoggerPtr logger;
    void hello();
};

foo.cpp

log4cxx::LoggerPtr Foo::logger(Logger::getLogger("foo"));

void Foo::hello() {
   LOG4CXX_INFO(logger, "Hello");
}

Did you have a compelling reason to make repeated calls to getLogger()?

If your caching improved performance, there must be some potential for
optimization to getLogger() which should be doing roughly the same thing
internally.  Frequent calls to getLogger() is an atypical usage pattern,
so it hasn't been benchmarked.


On Aug 18, 2009, at 3:19 PM, david.weber@l-3com.com wrote:

&gt; All,
&gt;
&gt; I was recently working on a project which was very time sensitive.   
&gt; Milliseconds were prescious, and we had great interest in using 
&gt; LOG4CXX, only in debugging problems (where time wasn't nearly as 
&gt; critical).
&gt;
&gt; On the web site, I saw that getLogger("asdf") will return the same 
&gt; object as a subsequent call to getLogger("asdf").  When we created 
&gt; multiple objects of the same type, each of which had a logger instance

&gt; with the same name, we profiled the code, and found that eacy 
&gt; getLogger() call was taking quite a lot of time.  Unfortunately the 
&gt; numbers are lost, but it was something like 100 us or ms.  These 
&gt; numbers are a world apart, but when it came to creating ~1000 of my 
&gt; own objects, the amount of time spent creating those loggers became 
&gt; unacceptable.
&gt;
&gt; We ultimately found that by creating a caching mechanism using a 
&gt; "loggerName" -&gt; "loggerObject" map, made the subsequent calls much 
&gt; more manageable.
&gt;
&gt; I was just wondering if anyone else has seen this sort of behavior.
&gt;
&gt; --dw



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