#6657 Design and implement a sensible and unified logging system for installers
Opened 7 years ago by mbabinsk. Modified 5 years ago

Currently there is no systematic interface for installers to emit messages to console and to log files. All that is being done is a haphazard mixture of raw print statements, direct calls to root loggers, and utilizing class specific loggers. Moreover, there is a great inconsistency in log levels used for various messages (e.g. info messages that should be debug, critical errors are logged and the installer continues, etc.).

A unified logging strategy would greatly improve both user experience and troubleshooting of problems during component configuration. A proper design discussion should precede the implementation in any case, but here are some random ideas that should be discussed:

  • class-level loggers should be replaced by module-level loggers

  • there should be a common apex for all loggers used in installers which should not be called directly. It should serve only for configuration of logging interface.

  • info-level should be used only for high-level messages you intend to display to the user. Detailed information is detailed for a reason and should be logged at debug or verbose level.

  • with the above point being enforced, we may now attach a separate handler that streams info-level messages to console stdout. In this way we can entirely replace plain print statements with info messages and let loggers do their work. As a bonus, everything that was previously only printed will be now logged to file and not lost after crashed install.


Metadata Update from @mbabinsk:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.5 backlog

7 years ago

Metadata Update from @rcritten:
- Issue close_status updated to: None

5 years ago

Login to comment on this ticket.

Metadata