Skip to content

Commit 8a37130

Browse files
Separate profiling middleware logs (#107)
* Separate profiling middleware logs * Profiling logs will write to 'profiling' logger instead of the standard 'security.middleware' logger * Fix typo
1 parent bc5429b commit 8a37130

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-security"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
homepage = "https://github.com/sdelements/django-security"
55
description = "Models, views, middlewares and forms to facilitate security hardening of Django applications."
66
authors = ["Security Compass <[email protected]>"]

security/middleware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from ua_parser import user_agent_parser
2323

2424
logger = logging.getLogger(__name__)
25+
profiling_logger = logging.getLogger("profiling")
26+
2527
DJANGO_CLICKJACKING_MIDDLEWARE_URL = (
2628
"https://docs.djangoproject.com/en/4.2/ref/clickjacking/"
2729
)
@@ -1212,6 +1214,6 @@ def __call__(self, request):
12121214
out.write(self.format_queries_and_time_for_logs(queries))
12131215

12141216
out.write(self.request_separator)
1215-
logger.debug(out.getvalue())
1217+
profiling_logger.debug(out.getvalue())
12161218

12171219
return response

0 commit comments

Comments
 (0)