Logging fixes

* only use snappea handler when there was already something configured
* in development, use the 'snappea' rather than the 'look below' version for snappea
This commit is contained in:
Klaas van Schelven
2024-05-22 17:34:29 +02:00
parent e331ef6d79
commit 34f58f9106
2 changed files with 7 additions and 3 deletions

View File

@@ -227,4 +227,5 @@ if I_AM_RUNNING == "SNAPPEA":
# We set all handlers to the snappea handler in this case: this way the things that are logged inside individual
# workers show up with the relevant worker-annotations (i.e. threadName).
for logger in LOGGING['loggers'].values():
logger["handlers"] = ["snappea"]
if "handlers" in logger and "console" in logger["handlers"]:
logger["handlers"] = ["snappea"]

View File

@@ -1,5 +1,5 @@
from .default import * # noqa
from .default import BASE_DIR, INSTALLED_APPS, MIDDLEWARE, LOGGING, DATABASES
from .default import BASE_DIR, INSTALLED_APPS, MIDDLEWARE, LOGGING, DATABASES, I_AM_RUNNING
import os
@@ -106,7 +106,10 @@ LOGGING["handlers"]["look_below_in_stream"] = {
"formatter": "look_below",
}
LOGGING['loggers']['bugsink.performance']["handlers"] = ["look_below_in_stream"]
if I_AM_RUNNING == "SNAPPEA":
LOGGING['loggers']['bugsink.performance']["handlers"] = ["snappea"]
else:
LOGGING['loggers']['bugsink.performance']["handlers"] = ["look_below_in_stream"]
# snappea development settings: see all details, and include timestamps (we have no sytemd journal here)