Hello and welcome back to the Python Logging Course. This is Lesson 9, Rotating Logs with Mike Driscoll. In this episode, you will learn how to rotate logs based on the file size. You'll also learn about timed rotations, rotating logs using a config file, and customization using the rotator and namer.
0:30
Let's learn about rotating logs based on file size. The most common way of rotating logs is to rotate them when you reach a specific file size. You might choose the file size based on your storage limits, the cost of parsing logger files, or for other reasons. For example, if you look at the system log in Linux,
0:52
you might notice that it is ginormous and you don't want to have a log file that is crazy long for you to dig through. Let's look at a code example. Here, this one is called simpleRotating.py. If you import login in time, and then you import the handler,
you might notice that it is ginormous and you don't want to have a log file that is crazy long for you to dig through. Let's look at a code example. Here, this one is called simpleRotating.py. If you import login in time, and then you import the handler,
Share this post