PyDocs

Nav

Generic Operating System Services

fileConfig

  • fileConfig(fname, defaults=None, disable_existing_loggers=True, encoding=None)
Read the logging configuration from a ConfigParser-format file.

This can be called several times from an application, allowing an end user
the ability to select from various pre-canned configurations (if the
developer provides a mechanism to present the choices and load the chosen
configuration).
Changed in 3.4, 3.10, 3.12
  • 3.4: An instance of a subclass of RawConfigParser is now accepted as a value for fname. This facilitates: Use of a configuration file where logging configuration is just part of the overall application configuration. Use of a configuration read from a file, and then modified by the using application (e.g. based on command-line parameters or other aspects of the runtime environment) before being passed to fileConfig. Changed in version 3.10: Added the encoding parameter. Changed in version 3.12: An exception will be thrown if the provided file doesn’t exist or is invalid or empty.
  • 3.10: Added the encoding parameter.
  • 3.12: An exception will be thrown if the provided file doesn’t exist or is invalid or empty.
0 Examples
No examples for logging.config/fileConfig.
See Also
No see-alsos for logging.config/fileConfig
0 Notes
No notes for fileConfig