updated python script to save log messages