Questions tagged [log4cplus]

log4cplus is a C++ logging library.

log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration.

It is modelled after the Java log4j API.

More info: Project page

136 questions
2
votes
1 answer

log4cplus: use clogger API to write a single log from multiple processes

I'm using log4cplus 1.2.0 C-API for two of my C applications, running on Linux. I want to log both processes actions on one logger. I'm using AsyncAppender, but for some reason, the prints I get are not sorted by time. When I sort the file, it all…
Vardit
  • 1,056
  • 2
  • 9
  • 20
2
votes
1 answer

C++ : How to use SocketAppender of log4cplus to send logs to logstash server?

I'm trying to send logs of my C++ application to logstash using log4cplus library. I have read the log4cplus documentation and used below configurations to configure SocketAppender. log4cplus.rootLogger=INFO,…
Durgesh Tanuku
  • 1,124
  • 2
  • 10
  • 26
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
1 answer

How to implement Appender inheriting class in Log4cplus

I want to use SMTP appender to send log messages to a given mail addres, using Log4cplus. Since Log4cplus does not have this appender, I know it is nesessary to extend/inherit the Appender class and implement my own SMTP appender. Since I haven't…
N.avraham
  • 333
  • 2
  • 15
2
votes
1 answer

Log4cplus: How can I integrate string into patternLayout?

I want to configure Log4cplus appender, using configuration file, to log messages that include parameters from my application (For example: logging the name of the current function that call the log4cplus logger). I know that Log4cplus has the…
N.avraham
  • 333
  • 2
  • 15
2
votes
1 answer

How to Implement Async logging in log4cplus

I want to implement AsyncAppender in log4cplus to write the event asynchronously into the file. Please guide me with any sample code.
2
votes
1 answer

log4cplus logs in Visual Studio debug console

How do I force log4cplus logs to show in Visual Studio 2013 debug console ? This is Qt application, standard ConsoleAppender does not write anything, RollingFileAppender works fine. There's also QtDebugAppender but it does not write to debug…
jakumate
  • 115
  • 8
2
votes
1 answer

Is it possible using log4cplus in C code?

I have searched the web and log4cplus documentation for the question on how to use the log4cplus library in a pure C code and haven't found a clear answer. Is it possible?
DavidS
  • 2,160
  • 1
  • 19
  • 22
2
votes
1 answer

Building log4cplus for Windows x64

I am supposed to build existing Windows 32bit project for Windows 64bit. (and probably linux 64bit too). The project uses log4cplus library. That one only contains 32bit .lib files at the moment and is shining example of why I hate using libraries…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
2
votes
2 answers

an error "undefined reference to 'log4cplus::Logger::operator=(log4cplus::Logger&&)'"

Now there is a problem when i want to compile a project which needs to ld liblog4cplus.a When i use the compile option -std=c++11 ,then there's an error Undefined reference to 'log4cplus::Logger::operator=(log4cplus::Logger&&)' but whole project…
Charlie
  • 21
  • 1
  • 2
2
votes
1 answer

Is there any documentation for the Log4cplus log properties files?

I've looked high and low and I can't find anything more than API docs which don't help at all with the log properties file. I'm specifically looking for help with: log4cplus.appender.SYSLOG=log4cplus::SysLogAppender #if not commented out, this line…
boatcoder
  • 17,525
  • 18
  • 114
  • 178
2
votes
1 answer

How do I add a custom filter in log4cplus?

This is a followup to this question on conditional logging. I found examples in the log4cplus test directory of how to configure filters in the properties file (so using the XML is unnecessary) I have created my own filter but I am having trouble…
2
votes
1 answer

Does log4cplus support xml configuration file and conditional logging?

I want to use MDC to set a context in my program, and then be able to set a filter in the config file to only show messages from a logger in a certain context. MDC mdc; mdc.put("fieldName", "foo"); LOG4CPLUS_DEBUG(log, "ABC");…
2
votes
0 answers

log4cplus truncates file despite configured to append

log4cplus is truncating a file when reopening it, despite me using a properties file with Append=True. What should the entries be to get this to append and not truncate? Here are the entries from my properties…
2
votes
1 answer

Eclipse has problems with log4cplus?

This has been annoying me for the past month or so. I haven't changed anything internally AFAIK, but suddenly my JFileChoosers started logging this whenever I clicked on a directory to open it: l o g 4 c p l u s : E R R O R N o a p p e n d e r s …
Octavia Togami
  • 4,186
  • 4
  • 31
  • 49
1 2
3
9 10