[Python] Summary of Django log output Basically, this method should be fine.
If it doesn't come out for some reason, I will use a custom logger. Reference: How to log with Django
import logging,os
logfile = os.path.dirname(__file__)+"log.txt"
logging.basicConfig(filename=logfile,level=logging.DEBUG)
logging.info("hogehoge")
When I thought that the file could not be created easily, the location specification of the logfile was strange. I was looking for a similar path in the previous article ...
Recommended Posts