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 priority set)
A log message will be printed only when the priority of the message is greater than or equal to the priority of the scenario.
In log4cpp, this scenario is often referred to as the Category. A Category must have the following values
- Appender: Destination of Logs
- Layout: Log format, Log Layout
- Priority: Priority of the Category, assuming only the values given above
This is clearly seen how the different values of Category are set in the sample log4cpp program. We can direct the logs to multiple places. We can also disable this feature for an application.
Comments: