Initially, the logs are written in messages file. Once this file reaches the max size(default 128KB), it is compressed and renamed to messages.0.gz. Once messages file reaches again the max size, messages.0.gz is renamed to messages.1.gz and messages is compressed and renamed to messages.0.gz. And so on until you reach the maximum number of files(10 by default). After that, the oldest log file is lost as new logs needs to be generated and there is a limitation on the number of the files where logs can be written.