On Friday, 22 March 2019 09:13:18 UTC+5:30, MRAB wrote: > On 2019-03-22 03:25, Sharan Basappa wrote: > > I am running a program and even though the program runs all fine, the log > > file is missing. I have pasted first few lines of the code. > > > > Any suggestions where I maybe going wrong? > > > > import os > > import csv > > import logging > > import assertion_design as asd > > import random > > > > #Create and configure logger > > logging.basicConfig(filename="test_1.log", filemode='w', > > format='%(asctime)s %(message)s') > > import os > > import csv > > import logging > > import assertion_design as asd > > import random > > > > #Create and configure logger > > logging.basicConfig(filename="test_1.log", filemode='w', > > format='%(asctime)s %(message)s') > > > Are you sure that you know where it's putting the log file? You have a > relative path there, but relative to where? Try it with an absolute path. > > Are you sure that it's logging anything? Log a simple message just after > configuring to double-check.
Would the file not get logged using the current directory? BTW, I changed the file location as follows and still I don't see it: logging.basicConfig(filename="D:\Users\sharanb\OneDrive - HCL Technologies Ltd\Projects\MyBackup\Projects\Initiatives\machine learning\programs\assertion\CNN\test_1.log", filemode='w', format='%(asctime)s %(message)s') -- https://mail.python.org/mailman/listinfo/python-list