Questions tagged [log4cpp]

A library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modelled after the Java library log4j, staying as close to their API as is reasonable.

A library of C++ classes for flexible logging to files, syslog, IDSA and other destinations, located at log4cpp.sourceforge.net. It is modelled after the prominent Log for Java library (log4j), staying as close to their API as is reasonable.

54 questions
72
votes
6 answers

What is the point of clog?

I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure…
markets
  • 9,344
  • 7
  • 34
  • 33
8
votes
4 answers

C++ Logging Library Setup

I've been trying for about 2 weeks now to get a logging library to work with. I've tried Log4cxx, Log4cpp, log4cplus and boost.log. The problem isn't that none of these work for me, it's that I can't figure out how to get them to work at all. I…
Shenlong55
  • 91
  • 1
  • 3
6
votes
3 answers

ETW tracking from .net, user mode and driver

We have an application that parts of it are in .net, c++ usermode and C++ drivers. The application is divided into several executables that run on demand and communication with each other using LPC(the processes run in different…
Jack Juiceson
  • 830
  • 4
  • 12
  • 24
6
votes
2 answers

getting started with log4cpp in windows

I need to do logging in a C++ application. After googling for a while, I decided to use log4cpp. is that a safe option to go with, or is there something better out there? How do I get started with installation and importing it to my application…
user228058
  • 465
  • 1
  • 7
  • 22
5
votes
3 answers

c++ concatenate different types into a string for function

I have different parts of my application calling a logger function to log details. Logger class std::string filename = "blahblah"; // variable to store the location of the properties file log4cpp::PropertyConfigurator::configure(filename); void…
Tony Tony
  • 455
  • 1
  • 4
  • 9
5
votes
1 answer

'long long long' is too long for GCC using log4cpp

I am developing a QT application where I use the logging library log4cpp. But now, where the headerfiles of log4pp are included, I get this compiling error: 'long long long' is too long for GCC When I go to the source of this error, the headerfile…
TheWieand
  • 253
  • 3
  • 18
3
votes
1 answer

How do I log several variables with log4cpp at once?

How do I log more than a single string with log4cpp? E.g. if I want to log all argv's to main: #include #include #include #include using namespace std; int…
Jörg Beyer
  • 3,631
  • 21
  • 35
3
votes
2 answers

log4cpp: Linux can't find the lib files

I download the log4cpp in my Linux and I use the commands below to install: ./configure make make check make install After that, I can find the lib files below in the path…
Yves
  • 11,597
  • 17
  • 83
  • 180
2
votes
4 answers

the best approaches for logging localization using c++

I am working on a multinational project where target audience for logs might be from two nationalities. Therefore it is becoming important to log in more than one language , I am thinking about writing to 2 different log folders based on language…
erin c
  • 1,345
  • 2
  • 20
  • 36
2
votes
1 answer

configure log4cplus to log to custom file at runtime

I am using configuration file to initialize log4cplus module. We use the below command in configuration file to specify the log file name to be generated. log4cplus.appender.log1.File=TestFile.log I want this TestFile.log to be generated at run…
user3168064
  • 97
  • 2
  • 11
2
votes
0 answers

How to create log file name with date and counter in log4cpp?

I'm trying to use log4cpp. I want to create log file name with this pattern: Number_AppName_Date.log Where: Number - is a sequential increment number (each time the application us running this number will be incremented by 1) AppName - Application…
user5109370
2
votes
1 answer

log4cpp (linux): can't write message into logfile

I use cpp under Linux and I want to use the log4cpp. I have tried to use it under windows with vs2013 and it worked very well. Now I am working under Linux and I got a problem: It doesn't work with file. Here is my test code: int main(int argc,…
Yves
  • 11,597
  • 17
  • 83
  • 180
2
votes
1 answer

Have log4cpp create a new log file during execution

I currently use Log4cpp for logging purposes on a Linux RHEL platform. I continuously log a daemon application. My problem is that the log file generated by log4cpp may get removed at anytime (with an rm command, a logrotate etc...) and although the…
SCO
  • 1,832
  • 1
  • 24
  • 45
2
votes
2 answers

Search a datetime in a log file using Binary Search in C/C++

I have some log files that is written by log4cpp format --By the nature of log4cpp, this file is sorted by the datetime at the beginning of each line Assuming the format is like 2012-09-02 17:17:36.891 This is line 1 in file 2 ... 2013-08-05…
Yifei
  • 1,944
  • 1
  • 14
  • 20
1
vote
0 answers

is log4cpp inter-process safe for writing to the same file?

I have started to use log4cpp. I ran some tests on it because I want to have multiple processes all writing to the same files. I know its thread safe, and I did some testing on inter-process writing, it seemed to work. But then I read this: 3.2. Is…
code_fodder
  • 15,263
  • 17
  • 90
  • 167
1
2 3 4