Commit e604e105 authored by Matthias's avatar Matthias
Browse files

improve logging

parent 592b4583
Pipeline #25888 passed with stages
in 2 minutes and 1 second
......@@ -8,6 +8,8 @@ k8sRequestsMemory: "128Mi"
k8sLimitsCpu: "0.4"
k8sLimitsMemory: "256Mi"
logLevel: DEBUG
drupalApiCredentials: drupal-live-api-credentials
sftpConfigs: internal-sftp-config
kafkaConfigs: prod-kafka-bootstrap-servers
......
......@@ -8,6 +8,8 @@ k8sRequestsMemory: "128Mi"
k8sLimitsCpu: "0.4"
k8sLimitsMemory: "256Mi"
logLevel: DEBUG
drupalApiCredentials: drupal-api-credentials
sftpConfigs: internal-sftp-config
kafkaConfigs: stage-kafka-bootstrap-servers
......
......@@ -8,6 +8,8 @@ k8sRequestsMemory: "128Mi"
k8sLimitsCpu: "0.4"
k8sLimitsMemory: "256Mi"
logLevel: DEBUG
drupalApiCredentials: drupal-api-credentials
sftpConfigs: internal-sftp-config
kafkaConfigs: test-kafka-bootstrap-servers
......
......@@ -11,4 +11,5 @@ data:
IMPORT_API_URL: {{ .Values.importApiUrl }}
DRUPAL_API_URL: {{ .Values.drupalApiUrl }}
TOPIC_CONFIGS: {{ .Values.topicConfigs }}
TOPIC_DRUPAL_EXPORT: {{ .Values.topicDrupalExport }}
\ No newline at end of file
TOPIC_DRUPAL_EXPORT: {{ .Values.topicDrupalExport }}
LOG_LEVEL: "{{ .Values.logLevel }}"
from import_api_app import create_app
import logging
import os
if __name__ == "__main__":
numeric_level = getattr(logging, os.getenv('LOG_LEVEL').upper(), None)
if not isinstance(numeric_level, int):
raise ValueError(f'Invalid log level: {os.getenv("LOG_LEVEL")}')
logging.basicConfig(format='%(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
level=numeric_level)
app = create_app()
app.run(host='0.0.0.0', debug=True)
Markdown is supported
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