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
0
votes
1 answer

Apache log4cxx 0.12.0 cmake scripts fail during test configuration

Version: apache-log4cxx-0.12.0.tar.gz Configuration: mkdir build; cd build && cmake -DBUILD_SHARED_LIBS=off -DAPR_STATIC=yes -DAPU_STATIC=yes .. Symptoms (log snippet): 32882 error: downloading…
SunSplat
  • 111
  • 1
  • 8
0
votes
1 answer

Log4cxx How to build C++ application with ODBC support

On RHEL 8, using Postgres 12. When I attempt to run a C++ application that uses log4cxx and an ODBCAppender to write some statements to a Postgres DB, I get the following error message: log4cxx: Can not activate ODBCAppender unless compiled with…
Jack Allen
  • 103
  • 1
  • 7
0
votes
1 answer

Can I use log4j in Java and log4cxx in C++ in a JNI project to store log in the same file?

I am writing a non Android JNI program, and the java side is using log4j for logging. Can I use log4cxx or log4cpp on the C++ side and share the same config as java, so that the native log will be stored in the same file? Are there any downside of…
0
votes
0 answers

Log4cxx: Hour based file rotation using appender

I am able to build log4cxx with following apr, apr-util and libexpat versions using Visual Studio 2019 on Windows 10 for both 32 bit and 64 bit(Disabled libiconv). apr-1.7.0, APR-util 1.6.1, log4cxx-0.10.0 and libexpat-R_2_2_10 To test whether…
SomGG
  • 1
  • 2
0
votes
1 answer

How to log to application log and security log from the same application

I have an application that needs to log "application log messages" to an appender and "security log messages" to another appender (security log messages cannot appear in the application log). I was thinking setting up my loggers like this: Logger…
Brian
  • 2,375
  • 4
  • 24
  • 35
0
votes
1 answer

cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln - failed

I'm trying to build expat library for 64-bit using VS 2019, for integrating with log4cxx. Downloaded the expat from here. Steps mentioned here are only linux. I tried to follow the steps mentioned in the package. But cmake is failing. There is no…
user3863360
  • 200
  • 7
0
votes
1 answer

How to log Δ character using LOG4CXX library

My project is multi-byte and the data to be logged contains the Δ character When i log I use it like this, Logger::getLogger(log_name)->info(szBuf); void info(const std::wstring& msg) const; but the Δ character is displayed ? How can I output it…
i like cat
  • 135
  • 8
0
votes
1 answer

Reading Property Info in Log4cxx

I am using log4cxx for writing to the log. This is my configuration for logging, Here i have log file size of of 4 MB. after that it will rewrite it self.I am able to log using following config file and c++ code. Now I wanted to read the properties…
Vikram Ranabhatt
  • 7,268
  • 15
  • 70
  • 133
0
votes
1 answer

Log4cxx properties file variable substitution

I have a properties file for log4cxx configuration with a variable name ${name}: Properties file example: log4j.rootLogger=INFO, FILE #…
Carlo Corradini
  • 2,927
  • 2
  • 18
  • 24
0
votes
1 answer

LOG4CXX_INFO clean wrapper that is not a #define

I am trying to wrap a #define macro in C++ into an inline or template function. In LOG4CXX it has a define such as: #define LOG4CXX_INFO(logger, message) { \ if (logger->isInfoEnabled()) {\ ::log4cxx::helpers::MessageBuffer oss_;…
Bowb
  • 28
  • 6
0
votes
1 answer

Log4cxx << operator causes access violation

I have a dll project in VS2008 which causes my application to throw access violation. I debugged and found that in Log4cxx line, LOG4CXX_DEBUG(logger, myMessage << doubleA << double B); the operator << is causing an issue. This is the case with all…
Sahaj
  • 13
  • 6
0
votes
1 answer

log4cxx asyncappender flush all logs before exiting

I am using Asynappender and DOMConfigurator to load the xml file. I am losing half of the logs. My application exits but only few logs appears in log file. I have found that calling close() method of AsyncAppender class processes pending events…
aaa
  • 415
  • 6
  • 15
0
votes
1 answer

How to use log4cxx RollingFileAppender on Windows

I'm trying to use log4cxx to log my application using RollingFileAppender on a Windows C++ console application. I would like to create a new log file every time the size reaches 1MB. Furthermore, when the desired size is reached, the file should be…
Daniele Mereu
  • 115
  • 1
  • 8
0
votes
1 answer

Using log4cxx as input counter

I want to add a counter that record how many data input per hour or per day. Since there is no timer in my code, I hope that log4cxx, which can handle daily log rotation, could help me. Like, every midnight, print a log showing how many data got in…
chinuy
  • 145
  • 1
  • 12
0
votes
1 answer

Two log lines are mixed with log4Cxx in c++

I have used the log4cxx in my project for logging purpose. But, recently I noticed that some two different log lines are mixed with each other. I am not sure what was the problem. For example, I am expecting the log lines like below, Printing the…
Ramachandran
  • 103
  • 12