Skip to content

Commit

Permalink
Merge branch 'Simple-optimisation-in-checking-existing-emails' of git…
Browse files Browse the repository at this point in the history
…hub.com:uktrade/lite-hmrc into Simple-optimisation-in-checking-existing-emails
  • Loading branch information
saruniitr committed Jun 22, 2021
2 parents ffec4b1 + 32f44a0 commit 10fa012
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ elastic-apm = "~=5.8"
sentry-sdk = "~=0.16"
typed-ast = "~=1.4.2"
mohawk = ">=1.1"
python-json-logger = "~=0.1"
psycopg2 = "~=2.8"
python-dateutil = "~=2.8"
requests = "~=2.21"
Expand Down
39 changes: 16 additions & 23 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import uuid

from environ import Env
from django_log_formatter_ecs import ECSFormatter

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
Expand Down Expand Up @@ -47,7 +48,7 @@
DJANGO_SECRET_KEY = env("DJANGO_SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = env.bool("DEBUG", False)

ALLOWED_HOSTS = "*"

Expand Down Expand Up @@ -187,17 +188,14 @@
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"json": {
"class": "pythonjsonlogger.jsonlogger.JsonFormatter",
"format": "(asctime)(levelname)(message)(filename)(lineno)(threadName)(name)(thread)(created)(process)(processName)(relativeCreated)(module)(funcName)(levelno)(msecs)(pathname)", # noqa
},
"ecs_formatter": {"class": "django_log_formatter_ecs.ECSFormatter"},
"simple": {"format": "{asctime} {levelname} {message}", "style": "{"},
"ecs_formatter": {"()": ECSFormatter},
},
"handlers": {
"console": {"class": "logging.StreamHandler", "formatter": "json"},
"stdout": {"class": "logging.StreamHandler", "formatter": "simple"},
"ecs": {"class": "logging.StreamHandler", "formatter": "ecs_formatter"},
},
"loggers": {"": {"handlers": ["console", "ecs"], "level": env("LOG_LEVEL").upper()}},
"root": {"handlers": ["stdout", "ecs"], "level": env("LOG_LEVEL").upper()},
}
else:
LOGGING = {"version": 1, "disable_existing_loggers": True}
Expand Down

0 comments on commit 10fa012

Please sign in to comment.