I need to get a win32 application to send logs to a syslog server. This application has been using log4cplus for years to write logs to a file. When I try to use the SysLogAppender class, the compiler gives me errors. Upon investigation, I noticed syslogappender.h, line 21:
#if defined(LOG4CPLUS_HAVE_SYSLOG_H) && !defined(_WIN32)
Well, I assume that since our application is a win32 app, this class won't compile, because of the !defined(_WIN32). Does this mean log4cplus doesn't support syslog in win32 applications? If it does, then what am I doing wrong?
Thank you!
SyslogAppender is not supported on Windows because it is implemented in terms of syslog(3) function which is not available on Windows. Because of that, logging into remote syslogd is not supported even on POSIX platform. It looks like it would be a nice feature to have, though. I am moving this into the Feature Requests tracker.
SyslogAppender works on Windows as well in 1.1.0 and later. The implementation is capable of using Syslog over UDP to a remote host.
Last edit: Václav Haisman 2013-01-08
Ticket moved from /p/log4cplus/feature-requests/13/