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 seen any example for inheriting and implementing an appender, I would like to ask: Can anyone share a code example or a reference of inheriting and implementing an appender class?
I will be greatfull for any help.
There are plenty of examples of that in the log4cplus source code. You basically need to inherit from
Appender
. Potentially, you might want to register your appender in appenders factory. Seefactory.h
.