The StreamHandler class, located in the core logging package, sends logging output to streams such as sys.stdout, sys.stderr or any file-like object(or, more precisely, any object which supports write() and flush() methods.)
class logging.StreamHandler(stream=None)
Returns a new instance of the StreamHandler class. If stream is specified, the instance will use it for logging output; otherwise, sys.stderr will be used.
emit(record)flush()setStream(stream)The FileHandler class, located in the core logging package, sends logging output to a disk file. It inherits the output functionality from StreamHandler.
class logging.FileHandler(filename, mode="a", encoding=None, delay=False)
Returns a new instance of the FileHandler class.
The specified file is opened and used as the stream for logging.
If mode is not specified, ‘a’ is used.
If encoding is not None, it is used to open the file with that encoding.
If delay is true , then file opening is deferred until the first call to emit().
By default, the file grows indefinitely.
close()emit(record)The NullHandler class, located in the core logging package, does not do any formatting or output. It is essentially a “no-op” handler for use by library developers.
