Confused About Python Loggin

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Jul 31 14:24:58 CEST 2009


On Jul 31, 12:41 pm, Jannik Sundø <j.su... at cs.ucl.ac.uk> wrote:
> Hi all. I think I fixed this problem by setting fileLogger.propagate =  
> 0. Otherwise it will propagate up to the root logger, which outputs to  
> stdout, as far as I can understand.
>

Only if you specifically configure it to do so - for example, calling
basicConfig() configures the root logger (if it has no handlers) by
adding a StreamHandler which outputs to sys.stderr.

You shouldn't need to set propagate - the script in Peter's reply
appears to do what you need.

Regards,

Vinay Sajip



More information about the Python-list mailing list