ENH give the log file a good extension name if not specified

I know you gave me the rights to commit to main repo, but since I am making changes to your code, so I thought that I still do a pull request.