11 #ifdef LOG4CPP_HAVE_SYSLOG 14 #include <sys/types.h> 34 }
else if (priority > 7) {
37 result = priorities[priority];
45 const std::string& syslogName,
59 openlog(_syslogName.c_str(), 0, _facility);
67 std::string message(_getLayout().format(event));
68 int priority = toSyslogPriority(event.priority);
69 ::syslog(priority | _facility,
"%s", message.c_str());
80 std::string name, syslog_name;
82 params.get_for(
"syslog appender").required(
"name", name)(
"syslog_name", syslog_name)
83 .optional(
"facility", facility);
84 return std::auto_ptr<Appender>(
new SyslogAppender(name, syslog_name, facility));
88 #endif // LOG4CPP_HAVE_SYSLOG static int toSyslogPriority(Priority::Value priority)
SyslogAppender(const std::string &name, const std::string &syslogName, int facility=LOG_USER)
std::auto_ptr< Appender > create_syslog_appender(const FactoryParams &)
normal but significant condition
action must be taken immediately
virtual void _append(const LoggingEvent &event)
const std::string _syslogName
virtual ~SyslogAppender()
LayoutAppender(const std::string &name)