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
1
vote
1 answer

How to use environment variable in log4cpp property file

I am using log4cpp for my C++ project. What I need is to generate log files in custom locations instead of current directory. For that, I have set some environment variables for log file path. The problem is how can I use this environment variables…
Hemant
  • 767
  • 6
  • 20
1
vote
1 answer

How to append Windows Username in log4cpp log

Below is my current pattern layout set: %d{%m/%d/%Y %H:%M:%S,%l} [%t] %-5p %c %x %m%n So it outputs as below to the log file; 06/13/2017 10:57:44,632 [3684] INFO MyLogCategory File: myclass.cpp Line: 59 My Logged Message I would like…
wonk
  • 23
  • 7
1
vote
0 answers

How to add LOG4CPP in my C++ project visual studio C++

I'm new with C++, after some research i want to add LOG4CPP to my current project and i really don't know where to begin. i downloaded the LOG4CPP package and i don't know what's next. i'm working on windows and using visual studio 2012, can someone…
BezWow
  • 11
  • 1
1
vote
0 answers

log4cpp crashing while loading properties file

I am implementing log4cpp im my project. See my Logger class implemented in the project. It is crashing in function doConfigure(initfile) defined in PropertyConfiguratorImpl.cpp file. More specifically in function call to _properties.load(in) call…
Tariq
  • 2,274
  • 4
  • 24
  • 40
1
vote
0 answers

How to add autotools-based project as biicode block?

I need to use log4cpp in my project and I'd like to add this library as biicode block. I read the documentation and tried to prepare the library for biicode. I get the source of log4cpp from sourceforge's git here. log4cpp already has…
hal
  • 1,705
  • 1
  • 22
  • 28
1
vote
0 answers

log4cpp and odd console output

I am trying to use log4cpp on my project. But everytime I try to write a log message in addition to the log message going to the log file I also get this message to the console window. /var/log/ngis/mixer.log.3 Here is the copy of the appropriate…
user846566
  • 373
  • 1
  • 3
  • 12
1
vote
2 answers

log4cpp - Unhandled exception and access violation

Here is some example code I read from some tutorial: int main(int argc, char* argv[]) { log4cpp::OstreamAppender* osAppender = new log4cpp::OstreamAppender("osAppender", &cout); osAppender->setLayout(new log4cpp::BasicLayout()); …
CDT
  • 73
  • 7
1
vote
1 answer

Linking log4cpp library to project with cmake

I am trying to link log4cpp to my project. I use CMake and i can't figure out a way to do so. Log4cpp is install on projectfolder/log4cpp/ (with bin/ include/ lib/ ... in it) I use the following Findlog4cpp.cmake : IF (LOG4CPP_FOUND) …
Tony Morris
  • 435
  • 4
  • 15
0
votes
0 answers

Why is log4cpp not writing to file when using systemctl

I have a small programm that writes someting to a log file on a event. When i run my programm via comandline ./main it works all fine. But when use systemctl Alarm.service no file is created. main.cpp void initLogger(){ log4cpp::PatternLayout*…
Darter
  • 11
  • 2
0
votes
1 answer

does vcpkg incorrectly delivers an old version of log4cpp?

it appears to me that vcpck delivers an old version (before Jun 3, 2017) of log4cpp to me. Probably it is my fault but what could I have done wrong? vcpkg contains log4cpp (see here) linking to this github repo. It appears that this is not the…
0
votes
0 answers

Adding a header line to log4cpp log files

I'm using log4cpp to log CSV data to log files that may wrap around and I want each log file to have a CSV column header. Is there a way to define the header line of a log4cpp log file, so that log4cpp always prependeds it to log files even after…
kenba
  • 4,303
  • 1
  • 23
  • 40
0
votes
0 answers

linking with log4cpp fails with Raspian Bullseye

I have an issue recompiling my code on a newly installed raspi. /usr/bin/g++ -c -Wall -g -O2 -fdebug-prefix-map=/build/log4cpp-E4MvbD/log4cpp-1.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -MD -MP -MF .dep/DataBlock.o.d…
dl2sba
  • 1
0
votes
0 answers

compile log4cpp for visual studio 2005

We have a legacy c++ project written by visual studio 2005. we want to replace it's internal logger with log4cpp. I downloaded version 1.1.3. But there is no ready-to-use solution for vs2005. So i created an empty win32 project: Configuration type:…
linarcx
  • 116
  • 3
  • 17
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
1 answer

Log4cpp: Print date in UTC/GMT time zone

I am working with log4cpp. Is there a way to print the timestamps/dates in log4cpp converted to GMT/UTC timezone ? At the moment I use %d which currently prints out the local time, however I want this in UTC/GMT.
Tee
  • 385
  • 3
  • 14