Commit bdea8be9 authored by Igor Ponomarev's avatar Igor Ponomarev Committed by Paweł Wieczorek
Browse files

docker/collabora: Use JSON logging

parent 4a96ca15
......@@ -34,6 +34,9 @@ RUN apt update && \
wait-for-it && \
rm /*deb
# Logging env
COPY docker/collabora/logging_env.yaml /
# We use configuration from the environment, not an env file, but we need this empty file
# to silence a warning from django-environ.
RUN touch /usr/lib/python3/dist-packages/lava_server/settings/.env
......
LOGGING:
version: 1
disable_existing_loggers: True
filters:
require_debug_false:
(): django.utils.log.RequireDebugFalse
formatters:
json_formatter:
(): lava_common.logging_utils.json_formatter
extra_keys:
- sql
- duration
- alias
handlers:
console:
class: logging.StreamHandler
formatter: json_formatter
level: DEBUG
loggers:
django:
handlers:
- console
level: ERROR
propagate: False
django_auth_ldap:
handlers:
- console
level: INFO
propagate: False
lava_results_app:
handlers:
- console
level: INFO
propagate: False
lava_scheduler_app:
handlers:
- console
level: INFO
propagate: False
lava-scheduler:
handlers:
- console
level: DEBUG
propagate: False
lava-publisher:
handlers:
- console
level: DEBUG
propagate: False
......@@ -9,6 +9,7 @@ DATABASE=`python3 -c 'import os; from urllib.parse import urlparse; url = urlpar
# Make sure configuration directories are available and have the appropriate
# ownership and permissions.
mkdir -p /etc/lava-server/settings.d
cp /logging_env.yaml /etc/lava-server/settings.d
mkdir -p /etc/lava-server/dispatcher.d
chown -R lavaserver: /etc/lava-server/dispatcher.d
......@@ -36,10 +37,10 @@ if [ -z $LOGLEVEL ]; then
LOGLEVEL=DEBUG
fi
/usr/bin/lava-server manage lava-publisher --level $LOGLEVEL --log-file - --host '*' --port 8001 &
/usr/bin/lava-server manage lava-publisher --host '*' --port 8001 &
while :; do
/usr/bin/lava-server manage lava-scheduler --level $LOGLEVEL --log-file - $EVENT_URL $IPV6
/usr/bin/lava-server manage lava-scheduler $EVENT_URL $IPV6
done &
if [ -z $WORKERS ]; then
......@@ -54,4 +55,4 @@ if [ -z $BIND ]; then
BIND="--bind 0.0.0.0:8000"
fi
exec /usr/bin/gunicorn3 lava_server.wsgi --log-level $LOGLEVEL --log-file - -u lavaserver -g lavaserver --worker-class $WORKER_CLASS --workers $WORKERS $BIND $RELOAD $TIMEOUT
exec /usr/bin/gunicorn3 lava_server.wsgi -u lavaserver -g lavaserver --worker-class $WORKER_CLASS --workers $WORKERS $BIND $RELOAD $TIMEOUT
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment