Create Log4cpp Layout
Apart from the Simple and Basic Layout of log4cpp, you can create your own log pattern using the Pattern Layout. But you can add certain strings to the pattern. If you want to add additional functionality like displaying process ID, hostname using functions like getpid(), gethostbyname(), you need to create your own layout. You can [...]
log4cpp Category
Every log message has a priority. But depending on the scenario we decide whether we need to log a message or not. Like every message has a priority, similarly every scenario has a priority. We have the following priorities arranged in the descending order. EMERG, FATAL ALERT CRIT ERROR WARN NOTICE INFO DEBUG NOTSET (no [...]
Three Important Steps for Log4cpp Programming
When you start working with log4cpp, you need to take care of the following steps Initializing an Appender Deciding on the Layout Finalize on the Category Let’s see what each of these mean. Appender: Appender in log4cpp corresponds to the destination of logs. A suitable appender is initialized based on your requirements. The destination of [...]