some formatting
Dieser Commit ist enthalten in:
Ursprung
b36d2706eb
Commit
455267fa2c
|
@ -5,11 +5,11 @@ import json
|
||||||
import logging
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
import threading
|
import threading
|
||||||
|
import traceback
|
||||||
from logging.config import dictConfig, fileConfig
|
from logging.config import dictConfig, fileConfig
|
||||||
|
|
||||||
from gunicorn.glogging import CONFIG_DEFAULTS
|
from gunicorn.glogging import CONFIG_DEFAULTS
|
||||||
from gunicorn.glogging import Logger as gLogger
|
from gunicorn.glogging import Logger as gLogger
|
||||||
import traceback
|
|
||||||
|
|
||||||
__version__ = "0.0.8"
|
__version__ = "0.0.8"
|
||||||
|
|
||||||
|
@ -77,7 +77,9 @@ class Logger(gLogger):
|
||||||
defaults = CONFIG_DEFAULTS.copy()
|
defaults = CONFIG_DEFAULTS.copy()
|
||||||
defaults["__file__"] = cfg.logconfig
|
defaults["__file__"] = cfg.logconfig
|
||||||
defaults["here"] = os.path.dirname(cfg.logconfig)
|
defaults["here"] = os.path.dirname(cfg.logconfig)
|
||||||
fileConfig(cfg.logconfig, defaults=defaults, disable_existing_loggers=False)
|
fileConfig(
|
||||||
|
cfg.logconfig, defaults=defaults, disable_existing_loggers=False
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
msg = "Error: log config '%s' not found"
|
msg = "Error: log config '%s' not found"
|
||||||
raise RuntimeError(msg % cfg.logconfig)
|
raise RuntimeError(msg % cfg.logconfig)
|
||||||
|
@ -91,7 +93,9 @@ class Logger(gLogger):
|
||||||
level = self.access_log.warning
|
level = self.access_log.warning
|
||||||
elif resp.status_code >= 500:
|
elif resp.status_code >= 500:
|
||||||
level = self.access_log.error
|
level = self.access_log.error
|
||||||
safe_atoms = self.atoms_wrapper_class(self.atoms(resp, req, environ, request_time))
|
safe_atoms = self.atoms_wrapper_class(
|
||||||
|
self.atoms(resp, req, environ, request_time)
|
||||||
|
)
|
||||||
extra = dict(
|
extra = dict(
|
||||||
METHOD=environ.get("REQUEST_METHOD"),
|
METHOD=environ.get("REQUEST_METHOD"),
|
||||||
PATH=environ.get("PATH_INFO"),
|
PATH=environ.get("PATH_INFO"),
|
||||||
|
|
Laden…
In neuem Issue referenzieren