Skip to content

Commit be0f16d

Browse files
committed
Example
1 parent a3104b1 commit be0f16d

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

example/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
media/
1+
media/
2+
*.log

example/example/settings.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,35 @@
9494
}
9595
}
9696

97+
LOGGING = {
98+
'version': 1,
99+
'disable_existing_loggers': False,
100+
'formatters': {
101+
'standard': {
102+
'format': '%(asctime)s %(filename)s:%(lineno)d %(levelname)s - %(message)s'
103+
},
104+
},
105+
'handlers': {
106+
'console': {
107+
'class': 'logging.StreamHandler',
108+
},
109+
'django_editorjs_fields': {
110+
'level': 'DEBUG',
111+
'class': 'logging.handlers.RotatingFileHandler',
112+
'filename': 'django_editorjs_fields.log',
113+
'maxBytes': 1024*1024*5, # 5 MB
114+
'backupCount': 5,
115+
'formatter': 'standard',
116+
},
117+
},
118+
'loggers': {
119+
'django_editorjs_fields': {
120+
'handlers': ['django_editorjs_fields', 'console'],
121+
'level': 'DEBUG',
122+
},
123+
},
124+
}
125+
97126

98127
# Password validation
99128
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

0 commit comments

Comments
 (0)