diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index aba4406d..0e1f38fd 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -7,6 +7,7 @@ on: - "poetry.lock" - ".nais/test-pr.yaml" - ".github/workflows/integration-test.yml" + - "gunicorn.conf.py" env: REGISTRY: europe-north1-docker.pkg.dev/nais-management-b3a7/dapla-metadata diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 8682a1b0..dbf68b39 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -1,6 +1,40 @@ """Configuration for the Gunicorn server.""" +import sys + bind = "0.0.0.0:8050" workers = 1 loglevel = "info" preload = True + +logconfig_dict = GUNICORN_LOG_CONFIG = { + "handlers": { + "console_stdout": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "stream": sys.stdout, + }, + }, + "loggers": { + "": {"handlers": ["console_stdout"], "level": "INFO", "propagate": False}, + "gunicorn": { + "handlers": ["console_stdout"], + "level": "INFO", + "propagate": False, + }, + "gunicorn.access": { + "handlers": ["console_stdout"], + "level": "INFO", + "propagate": False, + }, + "gunicorn.error": { + "handlers": ["console_stdout"], + "level": "INFO", + "propagate": False, + }, + }, + "root": { + "level": "INFO", + "handlers": ["console_stdout"], + }, +} diff --git a/src/datadoc/config.py b/src/datadoc/config.py index d0a29a19..1039d250 100644 --- a/src/datadoc/config.py +++ b/src/datadoc/config.py @@ -4,6 +4,7 @@ import logging import os +import sys from pathlib import Path from pprint import pformat from typing import Literal @@ -15,7 +16,7 @@ from datadoc.constants import DAPLA_MANUAL_TEXT from datadoc.frontend.components.builders import build_link_object -logging.basicConfig(level=logging.DEBUG, force=True) +logging.basicConfig(level=logging.DEBUG, force=True, stream=sys.stdout) logger = logging.getLogger(__name__)