Where does Python root logger store a log?

Question:

I’m using the Freebase Python library. It creates a log before executing:

self.log = logging.getLogger("freebase")

Where is this log in the file system? It’s not in the executing directory or tmp.

Asked By: Matt Norris

||

Answers:

That call does not store anything. It merely creates a logger object which can be bound and configured however you would like.

So if in your Python code, you were to add

logging.basicConfig(level=logging.WARNING)

All warnings and errors would be logged to the standard output (that’s what basicConfig does), including the calls that Freebase makes. If you want to log to the filesystem or other target, you’ll want to reference the logging module documentation for more information. You may also wish to reference the Logging HOWTO.

Answered By: Jason R. Coombs
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.