log4cpp::Appender – Destination of Logs
Posted by Joys of Programming on in C/C++
As pointed out in log4cpp tutorial, one of the important things while initializing logging using log4cpp is to decide the destination of the log. It can be any file often known as log file or even across the network. An object of the class log4cpp::Appender must be initialized for this purpose as shown in the log4cpp sample program. The following classes can be used to decide the destination of the logs.
- log4cpp::FileAppender : Appends the output to a file
- log4cpp::OstreamAppender : Appends the output to a ostream
- log4cpp::RollingFileAppender : If you want to roll back a file, after reaching a certain limit, you can make use of this class
- log4cpp::SyslogAppender : Outputs the log to a system log
- log4cpp::StringQueueAppender: This makes use of the in memory string queue. All the logs are stored in the queue.
Click on the individual links to understand more about each of the appenders.
Comments: