Questions tagged [log4cxx]

Apache log4cxx is a logging framework for C++ patterned after Apache log4j. Apache log4cxx uses Apache Portable Runtime for most platform-specific code and should be usable on any platform supported by APR. Apache log4cxx is licensed under the Apache License, an open source license certified by the Open Source Initiative.

Apache log4cxx is a logging framework for C++ patterned after Apache log4j. Apache log4cxx uses Apache Portable Runtime for most platform-specific code and should be usable on any platform supported by APR. Apache log4cxx is licensed under the Apache License, an open source license certified by the Open Source Initiative.

Almost every large application includes its own logging or tracing API. Inserting log statements into code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is usually the case for multithreaded applications and distributed applications at large.

Experience indicates that logging is an important component of the development cycle. It offeres several advantages. It provides precise context about a run of the application. Once inserted into the code, the generation of logging output requires no human intervention. Moreover, log output can be saved in persistent medium to be studied at a later time. In addition to its use in the development cycle, a sufficiently rich logging package can also be viewed as an auditing tool.

Logging does have its drawbacks. It can slow down an application. If too verbose, it can cause scrolling blindness. To alleviate these concerns, log4cxx is designed to be reliable, fast and extensible. Since logging is rarely the main focus of an application, the log4cxx API strives to be simple to understand and to use.

Official Website: http://logging.apache.org/log4cxx/

Useful Links:

178 questions
2
votes
3 answers

How to build log4cxx in Visual Studio 2015

I have been using log4cxx, it worked OK for my needs. We are moving to VS 2015 and I have discovered that the compiler in Visual Studio 2015 is throwing errors when I try to rebuild log4cxx 0.10.0.1. The build still works if I change the project…
Nik
  • 23
  • 1
  • 7
2
votes
2 answers

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…
Dimitri Tcaciuc
  • 5,053
  • 5
  • 20
  • 22
2
votes
2 answers

Variable length 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…
Horacio
  • 2,727
  • 5
  • 26
  • 29
2
votes
1 answer

Single definition of value used multiple times in log4cxx configuration

I have a log4cxx.xml configuration file which defines multiple rolling file appenders.
Troy Daniels
  • 3,270
  • 2
  • 25
  • 57
2
votes
2 answers

Local static pointer variable is not thread safe?

At my server module, sometimes log4cxx library made it crash. It's because ... LevelPtr Level::getTrace() { static LevelPtr level(new Level(Level::TRACE_INT, LOG4CXX_STR("TRACE"), 7)); return level; } static LevelPtr returns null ptr. I…
heon
  • 105
  • 9
2
votes
3 answers

Log4xx as Cocoa framework?

We're currently using log4xx on OS X as .dylib and having frequent runtime problems with applications failing to load the library, wrong paths, multiple libraries in each framework they're used in. Is there an existing project using log4xx as an OS…
cacau
  • 3,606
  • 3
  • 21
  • 42
2
votes
2 answers

How to solve undefined reference errors when linking log4cxx in qmake project

It's the second day I'm trying to marry Qt5, MinGW and log4cxx. Even after I've compiled everything successfully, linked apr, apr-util and log4cxx libraries, ld gives me a bunch of "undefined reference" problems. It looks like different settings…
Vlad
  • 301
  • 4
  • 10
2
votes
3 answers

Important but non-fatal log messages in logging frameworks (log4j, log4net, log4php, log4cxx, NLog)

In certain applications, there are important messages you always want to log (such as the application starting up and shutting down) regardless of the current log level setting. The only way to ensure an important message is logged using frameworks…
SharpC
  • 6,974
  • 4
  • 45
  • 40
2
votes
1 answer

LOG4CXX to Android Log

How can I easily replace the log4cxx for android log? I'm trying to re-define as: #define LOG4CXX_INFO(logger, message) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, message) But a compilation error is showed: xxxxx.cpp:122:13: error: no match for…
Victor
  • 8,309
  • 14
  • 80
  • 129
1
vote
0 answers

Log4cxx and Log4net should not create log file until there is something to log

Well I do not want log4cxx-Log4net create a file until there is something to log. Is It possible ? If yes, How can i do it?
Novalis
  • 2,265
  • 6
  • 39
  • 63
1
vote
1 answer

Process safe logging library for c++

Is there any process safe logging library which can write same file from multiple process for C++? I tried log4cxx. Some advices to use SocketConnector to write same file. But i did not find any real working sample.But any way i do not want my…
Novalis
  • 2,265
  • 6
  • 39
  • 63
1
vote
1 answer

Which conversion pattern specifier would give me 2 digit dates in log4cxx?

I am trying to use: but I am still getting a full 4 digit year. Is anybody familiar with getting 2 digit…
Palace Chan
  • 8,845
  • 11
  • 41
  • 93
1
vote
1 answer

Using Log4j CompositeTriggeringPolicy feature with log4CXX

I would like to combine both rolling time and rolling size in an appender, it seems there is no composite rolling in log4cxx, am I right ?
Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145
1
vote
1 answer

Using log4cxx with Visual Studio 2010. Application initialization error

I have succeeded to build the log4cxx library both in debug and release mode and created log4cxxd.lib and log4cxx.lib files. But when I try to use them with static linking in my visual C++ 2010 project I get The application failed to initialize…
Furkan
  • 683
  • 2
  • 10
  • 26
1
vote
3 answers

C++ | Compiling LOG4CXX AND APR

I would like to use external libraries in my project. For example the apache log4cxx. I'm compiling for windows. I know i have to compile first: Apache APR Apache APR-util Apache iconv. I saw only these three dependencies on the main page. I'm…
Francesco Rizzi
  • 631
  • 6
  • 24