I'm developing a script where it will look into logs every 10 minutes and if there's any critical error it will send an e-mail to a certain adress. I have this problem i would like to solve more elegant as possible: I would like to see the logs from /var/log/mysql/error.log but there is several logs. Example:error.log error.log.1.gzerror.log.2.gzerror.log.3.gzFrom my point of view there's two way to solve this problem:Solution 1:try: open(/var/log/mysql/error.log, rb)except IOError: try:  open(/var/log/mysql/error.log, rb) except IOError:  ....You can see that this will take several try/except and there's probally a better way to do it. I tried to figure out something instead of several try/except but with no luck. Could you guys point me at the right direction? Not give me the entire answer.Solution 2:Centralize the logs into one log only. That way i would have to only open a file instead of several try/except. This solution seems way more elegant. I have read the error.log page of mysql and I didn't find any answer there to my question.I guess a little background is necessary: it's my third day of Python and I have the basics of MySQL. 
mysql error.log centralize logs
logs;python;mysql