On Friday, March 27, 2020 at 3:15:50 PM UTC-4, dcwhatthe wrote:
> Hi,
> 
> 
> When we run
> 
> 
>     logging.basicConfig( filename = "TestLogging_" +
> datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + ".log" )
> 
> 
> , and then
> 
>     logging.error( "Test01\n" )
>     logging.debug("Test02\n")
>     logging.info("Test03\n")
>     logging.error( "Test04\n" )
> 
> 
> , only the error log lines get sent to the file.
> 
> 
> How do I get info() and debug() to go to the file, as well?

Got it.  Someone named Cameron, assisted with this.  For my purposes, I just 
needed to set the minimum level (INFO) inside the basic config function.  From 
there, the logging will take place for INFO and above, i.e. INFO, DEBUG, and 
ERROR in this case:


logging.basicConfig( filename = "TestLogging_" +
 datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + ".log", level = 
logging.INFO )


Thanks, Cameron.


Regards,

DC

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to