Implemented simple log file rotation.

Maybe you like it, maybe not :)
Just let me know what you think about the patch.