Project

General

Profile

Feature #22493

Updated by Lukas Zapletal over 6 years ago

Foreman uses logging gem for all logging, this has new plugin which enables structured logging into system journal (https://github.com/lzap/logging-journald). This feature will add configuration options to use the logging plugin. 

 Foreman already uses MDC (mapped diagnostic context) for session/request id. As part of this effort, we will add more MDC flags which are logged as structured fields in journald: 

 * logger name 
 * user login id and name 
 * organization label id and name 
 * location label 
 * request id 
 * session id (safe only) 
 * remote ip address session_safe id 

 As part of this, logging-journald will become hard dependency of foreman-core. Nothing is changing for development logging configuration, but for production we will make changes in the installer to send logs into journald and splitting them via rsyslog back into production.log for easier transition for existing users and tools. To be able to do that, all logs will be sent to facility local6 (configurable option). 

 Further reading: 

 * https://github.com/TwP/logging 
 * https://github.com/sandfoxme/journald-logger 
 * https://github.com/lzap/logging-journald

Back