salt.log.handlers.log4mongo_mod

Log4Mongo Logging Handler

This module provides a logging handler for sending salt logs to MongoDB

Configuration

In the salt configuration file (e.g. /etc/salt/{master,minion}):

log4mongo_handler:
  host: mongodb_host
  port: 27017
  database_name: logs
  collection: salt_logs
  username: logging
  password: reindeerflotilla
  write_concern: 0
  log_level: warning

Log Level

If not set, the log_level will be set to the level defined in the global configuration file setting.

Inspiration

This work was inspired by the Salt logging handlers for LogStash and Sentry and by the log4mongo Python implementation.