Skip to content

Instantly share code, notes, and snippets.

@laclaro
Created March 26, 2020 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laclaro/6cbd3f51bba0041d5307569644a575fc to your computer and use it in GitHub Desktop.
Save laclaro/6cbd3f51bba0041d5307569644a575fc to your computer and use it in GitHub Desktop.
logging.yml file for privacyIDEA
# logging configuration file /etc/privacyidea/logging.yml for privacyIDEA 3.3
# as given for the guide given at privacyidea.org
# https://www.privacyidea.org/event-based-logging-with-privacyidea-and-logstash
version: 1
formatters:
detail:
class: privacyidea.lib.log.SecureFormatter
format: >-
[%(asctime)s][%(process)d][%(thread)d][%(levelname)s][%(name)s:%(lineno)d]
%(message)s
handlers:
logfile:
class: logging.handlers.RotatingFileHandler
formatter: detail
backupCount: 5
maxBytes: 100000
filename: /var/log/privacyidea/privacyidea.log
level: INFO
auditfile:
class: logging.handlers.RotatingFileHandler
formatter: detail
backupCount: 5
maxBytes: 100000
filename: /var/log/privacyidea/audit.log
level: INFO
rootfile:
class: logging.handlers.RotatingFileHandler
formatter: detail
backupCount: 5
maxBytes: 100000
filename: /var/log/privacyidea/root.log
level: WARNING
# https://python-logstash-async.readthedocs.io/en/latest/config.html
logstash_async:
class: logstash_async.handler.AsynchronousLogstashHandler
host: 192.168.56.150
port: 5959
database_path: logstash_async_cache.sqlite
level: INFO
loggers:
privacyidea:
handlers:
- logfile
- logstash_async
level: DEBUG
pi-audit:
handlers:
- auditfile
- logstash_async
level: DEBUG
pi-eventlog:
handlers:
- logfile
- logstash_async
level: DEBUG
root:
handlers:
- rootfile
level: DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment