log4cpp::SyslogAppender(3)
log4cpp::SyslogAppender(3) β Library Functions Manual π
Okay bestie, this is the log4cpp::SyslogAppender page, and itβs basically the little bridge that sends LoggingEvents straight to your local syslog system. No cap. π¦
πΈ NAME πΈ
log4cpp::SyslogAppender β a SyslogAppender that sends LoggingEvents to the local syslog system. Periodt. π
β¨ SYNOPSIS β¨
#include <SyslogAppender.hh>
Inherits log4cpp::LayoutAppender.
π Public Member Functions π
SyslogAppender (const std::string &name, const std::string &syslogName, int facility=LOG_USER)β instantiate aSyslogAppenderwith the givenname,syslogName, andfacilityfor syslog.virtual ~SyslogAppender ()β the virtual destructor.virtual bool reopen ()β callscloselog(3)andopenlog(3).virtual void close ()β callscloselog(3)to close the syslog file descriptor.
π¦ Public Member Functions inherited from log4cpp::LayoutAppender π¦
LayoutAppender (const std::string &name)β constructor.virtual ~LayoutAppender ()β virtual destructor.virtual bool requiresLayout () constβ check if the appender requires a layout.virtual void setLayout (Layout *layout=NULL)β set theLayoutfor this appender.
π Public Member Functions inherited from log4cpp::AppenderSkeleton π
virtual ~AppenderSkeleton ()β destructor forAppenderSkeleton.virtual void doAppend (const LoggingEvent &event)β log in an appender-specific way.virtual void setThreshold (Priority::Value priority)β set the threshold priority of thisAppender.virtual Priority::Value getThreshold ()β get the threshold priority of thisAppender.virtual void setFilter (Filter *filter)β set aFilterfor this appender.virtual Filter * getFilter ()β get theFilterfor this appender.
π Public Member Functions inherited from log4cpp::Appender π
virtual ~Appender ()β destructor forAppender.const std::string & getName () constβ get the name of this appender.
β Static Public Member Functions β
static int toSyslogPriority (Priority::Value priority)β translates a log4cpp priority to a syslog priority.
π Static Public Member Functions inherited from log4cpp::Appender π
static Appender * getAppender (const std::string &name)β get a pointer to an exitsingAppender.static bool reopenAll ()β callreopen()on all existingAppenders.static void closeAll ()β callreopen()on all existingAppenders.
π«Ά Protected Member Functions π«Ά
virtual void open ()β callsopenlog(3).virtual void _append (const LoggingEvent &event)β sends aLoggingEventto syslog.
πΈ Protected Member Functions inherited from log4cpp::LayoutAppender πΈ
Layout & _getLayout ()β return the layout of the appender.
π¦ Protected Member Functions inherited from log4cpp::AppenderSkeleton π¦
AppenderSkeleton (const std::string &name)β constructor forAppenderSkeleton.
π« Protected Member Functions inherited from log4cpp::Appender π«
Appender (const std::string &name)β constructor forAppender.
π Protected Attributes π
const std::string _syslogNameint _facility
π Additional Inherited Members π
π Public Types inherited from log4cpp::LayoutAppender π
typedef BasicLayout DefaultLayoutType
π Detailed Description π
SyslogAppender sends LoggingEvents to the local syslog system. Thatβs the whole mood. π«
π Constructor & Destructor Documentation π
log4cpp::SyslogAppender::SyslogAppender (const std::string & name, const std::string & syslogName, int facility = LOG_USER)
Instantiate a SyslogAppender with the given name, syslogName, and facility for syslog.
π¨ caveat, bestie: the C syslog API is process global, so instantion of a second SyslogAppender will 'overwrite' the syslog name of the first. π
Parameters
- name β the name of the
Appender. - syslogName β the
identparameter in theopenlog(3)call. - facility β the syslog facility to log to. Defaults to
LOG_USER.
virtual log4cpp::SyslogAppender::~SyslogAppender () β [virtual]
Virtual destructor.
π Member Function Documentation π
virtual void log4cpp::SyslogAppender::_append (const LoggingEvent & event) β [protected], [virtual]
Sends a LoggingEvent to syslog.
Parameters
- event β the
LoggingEventto log.
Implements log4cpp::AppenderSkeleton.
virtual void log4cpp::SyslogAppender::close () β [virtual]
Calls closelog(3) to close the syslog file descriptor.
Implements log4cpp::AppenderSkeleton.
virtual void log4cpp::SyslogAppender::open () β [protected], [virtual]
Calls openlog(3).
virtual bool log4cpp::SyslogAppender::reopen () β [virtual]
Calls closelog(3) and openlog(3).
Reimplemented from log4cpp::AppenderSkeleton.
int log4cpp::SyslogAppender::toSyslogPriority (Priority::Value priority) β [static]
Translates a log4cpp priority to a syslog priority.
Parameters
- priority β the log4cpp priority.
Returns
- the syslog priority.
π§ Member Data Documentation π§
int log4cpp::SyslogAppender::_facilityβ[protected]const std::string log4cpp::SyslogAppender::_syslogNameβ[protected]
π₯ Author π₯
Generated automatically by Doxygen for log4cpp from the source code. Slay, automation. π€π
source:log4cppΒ· version:1.1Β· manual page:log4cpp::SyslogAppender(3)Β· date: the footer has no date, bestie π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms