Tuesday, 15 July 2014

Is there a difference between RotatingFileHandler and logrotate.d + WatchedFileHandler for Python log rotation? -


Python has its own RotatingFileHandler , which will automatically rotate log files. As part of the Linux application, it will need to rotate the log file every two weeks / months, I am thinking that it should have a config file in logrotate.d and WatchedFileHandler Instead

Is there any difference in what they do? Is a method considered safe, more efficient or better than the other?

What is your audience interested in the program?

If you are building a desktop application and most users can not expect to read logs, you should manage it for them. Not just rotating, but also removing older people - you do not want to fill the poor user's hard drive!

On the other hand, if viewers experience Unix sysadmins, then take a different view.

Sisadman will need those features which you probably will not anticipate You can. Send them by email, write them only in AdSense-storage, you name it for this audience, it would be best for you if your logging is as flexible as possible. Flexible (in Unix) means simple - just write on a file and consider completing it.

In addition, sysadmins do not want to learn again how to re-enter . Even if you want to provide this type of facility, make sure that the default is reasonable within this notion.

Finally Tdelaney raised an important issue: standard FileHandler does not pay much attention to the file which is writing it, you should use it, which specifically for this purpose Was written


No comments:

Post a Comment