distgit/pagure: Log auth-related into in a file on disk and create the place for it

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-07-23 12:59:20 +02:00
parent 4a93e4f1e0
commit 7c51566c36
2 changed files with 49 additions and 0 deletions

View file

@ -105,6 +105,13 @@
tags:
- pagure
- name: create the /var/log/pagure folder where to store the logs
file: state=directory
path=/var/log/pagure
owner=pagure group=packager mode=0775
tags:
- pagure
- name: create the /srv/tmp folder where to clone repos
file: state=directory
path=/srv/tmp

View file

@ -6,3 +6,45 @@ os.umask(0o002)
DB_URL = 'postgresql://{{ distgit_pagure_db_ro_user }}:{{ distgit_pagure_db_ro_pass }}@{{ pagure_db_host }}/{{ distgit_pagure_db_name }}'
{% include "pagure_shared.cfg" %}
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"
},
},
"handlers": {
"console": {
"formatter": "standard",
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
"level": "WARN",
},
"auth_handler": {
"formatter": "standard",
"class": "logging.handlers.TimedRotatingFileHandler",
"filename": "/var/log/pagure/pagure_auth.log",
"backupCount": 10,
"utc": True,
"when": "midnight",
},
},
# The root logger configuration; this is a catch-all configuration
# that applies to all log messages not handled by a different logger
"root": {"level": "WARN", "handlers": ["console"]},
"loggers": {
"pagure": {
"handlers": ["auth_handler"],
"level": "INFO",
"propagate": True,
},
"pagure_auth": {
"handlers": ["auth_handler"],
"level": "DEBUG",
"propagate": False,
},
},
}