config/conf/logs.py: logs file qo'shildi, muntazam ravishda loglarni yozib borish uchun
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ db.sqlite3
|
|||||||
db.sqlite3-journal
|
db.sqlite3-journal
|
||||||
resources/media
|
resources/media
|
||||||
resources/static
|
resources/static
|
||||||
|
resources/logs
|
||||||
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
|
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
|
||||||
# in your Git repository. Update and uncomment the following line accordingly.
|
# in your Git repository. Update and uncomment the following line accordingly.
|
||||||
# <django-project-name>/staticfiles/
|
# <django-project-name>/staticfiles/
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ from .djangorestframework import *
|
|||||||
from .simple_jwt import *
|
from .simple_jwt import *
|
||||||
from .jazzmin import *
|
from .jazzmin import *
|
||||||
from .cors_headers import *
|
from .cors_headers import *
|
||||||
|
from .logs import *
|
||||||
27
config/conf/logs.py
Normal file
27
config/conf/logs.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
LOGGING = {
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
"formatters": {
|
||||||
|
"verbose": {
|
||||||
|
"format": "{levelname} {asctime} {module} {message}",
|
||||||
|
"style": "{",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"handlers": {
|
||||||
|
"daily_rotating_file": {
|
||||||
|
"level": "INFO",
|
||||||
|
"class": "logging.handlers.TimedRotatingFileHandler",
|
||||||
|
"filename": "resources/logs/django.log",
|
||||||
|
"when": "midnight",
|
||||||
|
"backupCount": 30,
|
||||||
|
"formatter": "verbose",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"django": {
|
||||||
|
"handlers": ["daily_rotating_file"],
|
||||||
|
"level": "INFO",
|
||||||
|
"propagate": True,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
mkdir -p resources/logs
|
||||||
|
|
||||||
python3 manage.py collectstatic --noinput
|
python3 manage.py collectstatic --noinput
|
||||||
python3 manage.py migrate --noinput
|
python3 manage.py migrate --noinput
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
mkdir -p resources/logs
|
||||||
|
|
||||||
python3 manage.py collectstatic --noinput
|
python3 manage.py collectstatic --noinput
|
||||||
python3 manage.py migrate --noinput
|
python3 manage.py migrate --noinput
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user