0:00
/
0:00
Transcript
0:05
SPEAKER 1
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,

Rotating Logs in Python (Video)

Learn how to rotate logs in this video that is based on my book, Python Logging.

You can also purchase the Python Logging Video Course which includes this video and many others.

The Python Papers is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Discussion about this video

User's avatar
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,