BUG Move setting of log_active flag down...
BUG Move setting of log_active flag down
Previously, if there was an error opening the file (e.g., permission denied),
then the object would end up in a state where log_active was True, but there
was no logfile. The result was constant errors.