create log test
All checks were successful
Build And Test / build-and-push (push) Successful in 4m22s

This commit is contained in:
2025-04-14 13:30:39 +09:00
parent da71282a05
commit 2796994608
3 changed files with 71 additions and 4 deletions

View File

@ -36,7 +36,59 @@ SECRET_KEY = 'django-insecure-fh+awf3$$^el9(#*-dpuv&++#rck@1+s=o1mx+#etv)!lpq@_5
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = int(os.environ.get('DEBUG', 1))
LOGGING = {
'version': 1,
'disable_existing_loggers': False, # Django 기본 로거 유지
'formatters': {
'standard': {
'format': '[{asctime}] {levelname} {name}:{lineno} {message}',
'style': '{',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler', # 콘솔 출력
'formatter': 'standard',
},
},
'root': {
'handlers': ['console'],
'level': 'INFO', # 기본 레벨 (애플리케이션 코드)
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO', # Django 프레임워크 전반
'propagate': False,
},
'django.request': {
'handlers': ['console'],
'level': 'ERROR', # 요청 관련 에러만 (500 에러 같은 것)
'propagate': False,
},
'django.db.backends': {
'handlers': ['console'],
'level': 'WARNING', # DB 쿼리 경고만
'propagate': False,
},
'django.security': {
'handlers': ['console'],
'level': 'WARNING', # 보안 관련 경고
'propagate': False,
},
# mattermost send message log 너무 많이 나와서 조정
'apscheduler': {
'handlers': ['console'],
'level': 'WARNING', # INFO 로그 안 보이게 함 | 'CRITICAL'로 맞추면 사실상 아무것도 안 찍힘
'propagate': False,
},
},
}
# if DEBUG:
# LOGGING['loggers']['django.db.backends']['level'] = 'DEBUG'
ALLOWED_HOSTS = ["*"]