Skip to content

Instantly share code, notes, and snippets.

@laclaro
Last active March 18, 2020 10:18
Show Gist options
  • Save laclaro/9d920d628156de57d217a38c3a1d6b18 to your computer and use it in GitHub Desktop.
Save laclaro/9d920d628156de57d217a38c3a1d6b18 to your computer and use it in GitHub Desktop.
Logging configuration for privacyIDEA with 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: 1000000
filename: /var/log/privacyidea/audit.log
level: INFO
rootfile:
class: logging.handlers.RotatingFileHandler
formatter: detail
backupCount: 1
maxBytes: 1000000
filename: /var/log/privacyidea/root.log
level: INFO
logstash:
class: logstash.TCPLogstashHandler
# do NOT use formatter: detail
host: 192.168.56.150
port: 5959
tags:
- 'privacyidea'
version: 1
level: INFO
# the logger names are the qualnames to match
loggers:
privacyidea:
handlers:
- logfile
- logstash
level: DEBUG
werkzeug:
handlers:
- logfile
- logstash
level: DEBUG
pi-audit:
handlers:
- auditfile
- logstash
level: DEBUG
root:
handlers:
- rootfile
level: NOTSET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment