Currently if I run the following code from the python command line it writes to the file specified by filename as expected.
filename
import logging def test
Switch the Python Engine to Internal. Go to run-->Pyhton Engine-->Internal