Redis Log Format and Log Levels
For server monitoring I was interested in the log format for Redis. The Redis log format and log levels are not documented so I dug into the source code and this post goes over what I found.
Redis has four log levels: debug, verbose, notice, and warning.
#define LL_DEBUG 0
#define LL_VERBOSE 1
#define LL_NOTICE 2
#define LL_WARNING 3
The notation used in the log is defined as:
const char *c = ".-*#";
The default verbosity log level is notice.
In the log files the various log levels are represented as follows:
.
debug-
verbose*
notice#
warning
Another way to think of it is: dot, line 3 lines, and 4 lines.
The log output for Redis 2.x will look something like this:
[pid] date loglevel message
For instance:
[4018] 14 Nov 07:01:22.119 * Background saving terminated with success
The log output for Redis 3.x changes slightly and adds "role"
pid:role timestamp loglevel message
The possible values for role are as follows:
X
sentinelC
RDB/AOF writing childS
slaveM
master