log4cxx

mixing log4cxx and log4net

I have a c++ application which logs to some file using log4cxx (RollingFile appender). I want to log into the same file, at the same time, from another module written in c#; so i configured log4net to use the same file, but i can't get the new messages in. If i deactivate the c++ logging, i can see c# messages. So i think it is a locking...

Log4cxx custom appender

Is it possible to write a custom appender for log4cxx and have it configurable via a properties file (like the built-in appenders)? I'd prefer doing this without having to rebuild log4cxx (e.g. by deriving/extending an existing appender), if possible. Can you point me toward an example? ...

Configure log4cxx to write a file to the user APPDATA directory

Hi all, I just recently built the latest version (which is several years old I think) version of log4cxx and am trying to write a log file to the user APPDATA path: C:\Documents and Settings\%user%\Application Data\Logs\Application.log but I can't seem to get the configuration right: log4j.rootLogger=DEBUG, A1 log4j.appender.A1=org....

log4cxx time based rolling on Windows

Has anyone had any success getting log4cxx to roll files based upon time on Windows? It seems from the unit test cases and the behavior I can observe that this does not work at all on win32 platforms. My config is below in case I've made a mistake there: log4j.rootLogger=DEBUG, A1 log4j.appender.A1=org.apache.log4j.RollingFileAppender...

Building log4cxx on visual 2005

Hello, When I build the log4cxx on Visual 2005 according to instructions http://logging.apache.org/log4cxx/building/vstudio.html, I am getting error below; 1>------ Build started: Project: apr, Configuration: Debug Win32 ------ 1>Compiling... 1>userinfo.c 1>c:\program files\microsoft visual studio 8\vc\platformsdk\include\rpcndr.h(145)...

C++ inline String formatting and numeric conversion

Hello all, C# has a nice static method String.Format(string, params string[]); that returns a new string with the formatting and values that are provided. Is there an equivalent in C++? The reason is because I'm using log4cxx and want to take advantage of the macros like LOG4CXX_DEBUG( logger, expr ); that uses short-circuit ev...

log4j/log4cxx : exclusive 1 to 1 relation between logger and appender

Using the xml configuration of log4cxx (which is identical in configuration to log4j). I want to have a certain logger output exclusively to a specific appender (have it the only logger which outputs to that appender). I found that it's possible to bind a logger to a specific appender like this: <logger name="LoggerName"> <level va...

Variable lenght arguments in log4cxx LOG4CXX_ macros

I am using log4cxx in a big C++ project but I really don't like how log4cxx handles multiple variables when logging: LOG4CXX_DEBUG(logger, "test " << var1 << " and " << var3 " and .....) I prefer using printf like variable length arguments: LOG4CXX_DEBUG(logger, "test %d and %d", var1, var3) So I implemented this small wrapper on top...

Log4cxx sample program and steps to compile

Hi guys Hoping someone can help out.. I've been scouring the net for a simple how-to to get a good log4cxx program working, with steps on setting up the libraries, dependants, directives, library paths etc etc.. as of yet i've found a lot of valuable but disjointed information.. trying to pull it all together has been a bit of a nightma...

Managing logs/warnings in Python extensions

TL;DR version: What do you use for configurable (and preferably captured) logging inside your C++ bits in a Python project? Details follow. Say you have a a few compiled .so modules that may need to do some error checking and warn user of (partially) incorrect data. Currently I'm having a pretty simplistic setup where I'm using logging ...

Log4cxx configuration of appender

Hello, I use the library log4cxx in a c++ cross-platform project. We decide to use configuration file in XML. I have three questions: i use simple appenders of type "org.apache.log4j.FileAppender" for some loggers with the same layout. But i want that the loggers write in different files. I created some appenders with different name ...

static linking log4c-1.2.1 with Fedora 12 and Eclipse 3.5.1

Hello All, We are building a project that requires log4c to be linked in the static mode, the following is part of the linker error that is being generated. /usr/local/lib/liblog4c.a(domnode-expat.o): In function `sd_domnode_read': /log4c-1.2.1/src/sd/domnode-expat.c:316: undefined reference to `XML_ParserCreate' /log4c-1.2.1/src/sd/do...

multiple apps writing to the same log file using log4cxx?

can more than one application write to the same log file using log4cxx?? do i have to do anything different for more than one application to write to the same log file? this is how my xml file is currently setup: <?xml version="1.0" encoding="UTF-8"?> <log4j:configuration debug="true" xmlns:log4j='http://jakarta.apache.org/log4cxx/'&g...

log4cxx custom LoggingEvent.timeStamp

Greetings, I'm having trouble finding a good solution for initializing LoggingEvent.timeStamp to a custom value. In short, in our system machine time is meaningless and we want all our logs etc to use a "simutime" ie simulation time. What would be ideal is if we could somehow instruct log4cxx to everywhere instantiate say MyLoggingEven...

log4cxx Linking error - utf8 flag enabled

Hello, I'm working on Windows XP, VS2005. In addition I'm using log4cxx and it worked perfect for me. One day we decided to add Unicode support (UTF-8, cause we using utf-8 in our code base) to the logger. We found that we should change only two flags to make it work with unicode: LOG4CXX_LOGCHAR_IS_UTF8 1 (instead of 0, in log4cxx.h) ...

log4c documenation

Hello, gcc 4.4.3 c89 I am just getting started with log4c. However, there is very little documentation out there for how to get started with it. I am wondering does anyone know of any tutorials, articles on how to get started? Many thanks, ...

Linux Log4CXX Log4J

What is better in my application (called MyApp) that has the following 2 classes. MyApp is a multithreaded application requiring ClassA and ClassB. Also ClassA and ClassB spawn P-threads. The underlying system is Linux and the logging library used is Apache's Log4CXX. //ClassA: LoggerPtr ClassA::logger(Logger::getLogger("ClassA")); //C...

log4cxx -- Causing Problems in PHP Program using COM

I'm starting a project in PHP using COM ("Component Object Model"). Basically, I have a Windows program that has an API that I want to use, but I want to write the program using PHP. I want the entire program to use the command line. So far I am creating the COM object and giving it a command, and I'm getting an error: log4cxx: La...