can logging outputs which appear on the terminal be redirected to a text file? I have tried
                z = open('/mnt/sdc1/Ryan/Marx/newfile.txt'.format(file), 'w')
                sys.stdout= sys.stderr = z
                print ('Running the Algoritm Now for case {}'.format(file))
                run_liver_mpct_algorithms(data_paths, model_paths,[0], int(data_paths['batch_size']), data_paths['task_str']))
                z.close()
In th file z This gives me only the traceback of the error and print statements ,inside of the run_liver_mpct_algorithms there are many logging outputs which i would also like to go in the file.
Any ideas would be helpful,Thanks !
 
    