File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed
pythonkr_backend/pythonkr_backend/settings Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change 28
28
BUILD_DIR = os .path .join ("/home/pk/bakery_static" , "build" )
29
29
30
30
31
- logger = logging .getLogger ('root' )
31
+ LOGGING_CONFIG = None
32
+ # Django logging to file with rotation
33
+ LOGGING = {
34
+ 'version' : 1 ,
35
+ 'disable_existing_loggers' : False ,
36
+ 'formatters' : {
37
+ 'verbose' : {
38
+ 'format' : '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
39
+ },
40
+ },
41
+ 'handlers' : {
42
+ 'apps_file' : {
43
+ 'level' : 'INFO' ,
44
+ 'class' : 'logging.handlers.RotatingFileHandler' ,
45
+ 'filename' : '/home/pk/log/apps.log' ,
46
+ 'maxBytes' : 5242880 , # 5MB
47
+ 'backupCount' : 5 ,
48
+ 'formatter' : 'verbose' ,
49
+ },
50
+ },
51
+ 'loggers' : {
52
+ '' : {
53
+ 'handlers' : ['apps_file' ],
54
+ 'level' : 'INFO' ,
55
+ 'propagate' : True ,
56
+ },
57
+ },
58
+ }
59
+
60
+ import logging .config
61
+
62
+ logging .config .dictConfig (LOGGING )
63
+
64
+
65
+
66
+
67
+ logger = logging .getLogger ('' )
32
68
33
69
# service_version
34
70
sha_service_version = os .environ .get ("SHA" )
45
81
logfire .configure (environment = 'prod' , service_name = "web" , service_version = sha_service_version )
46
82
logfire .instrument_system_metrics ()
47
83
logfire .instrument_django ()
48
- logfire .instrument_psycopg ('psycopg' )
84
+ logfire .instrument_psycopg ('psycopg' )
85
+
You can’t perform that action at this time.
0 commit comments