ilhee commited on
Commit
8208fa0
·
1 Parent(s): 4e5f4b8

reset 명령과 로그 시간 남기도록 수정.

Browse files
Files changed (3) hide show
  1. log_config.json +33 -0
  2. resetlog.sh +3 -0
  3. run-service.sh +2 -1
log_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "disable_existing_loggers": false,
4
+ "formatters": {
5
+ "default": {
6
+ "()": "uvicorn.logging.DefaultFormatter",
7
+ "fmt": "%(asctime)s %(levelprefix)s %(message)s",
8
+ "datefmt": "%Y-%m-%d %H:%M:%S"
9
+ },
10
+ "access": {
11
+ "()": "uvicorn.logging.AccessFormatter",
12
+ "fmt": "%(asctime)s %(levelprefix)s %(message)s",
13
+ "datefmt": "%Y-%m-%d %H:%M:%S"
14
+ }
15
+ },
16
+ "handlers": {
17
+ "default": {
18
+ "formatter": "default",
19
+ "class": "logging.StreamHandler",
20
+ "stream": "ext://sys.stderr"
21
+ },
22
+ "access": {
23
+ "formatter": "access",
24
+ "class": "logging.StreamHandler",
25
+ "stream": "ext://sys.stdout"
26
+ }
27
+ },
28
+ "loggers": {
29
+ "uvicorn": {"handlers": ["default"], "level": "INFO"},
30
+ "uvicorn.error": {"level": "INFO"},
31
+ "uvicorn.access": {"handlers": ["access"], "level": "INFO", "propagate": false}
32
+ }
33
+ }
resetlog.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/bash
2
+ cp nohup.out $(date +%Y-%m-%d).log
3
+ cat /dev/null > nohup.out
run-service.sh CHANGED
@@ -1,2 +1,3 @@
1
  #!/bin/bash
2
- nohup .venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000 &
 
 
1
  #!/bin/bash
2
+ #nohup .venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000 &
3
+ TZ="Asia/Seoul" nohup .venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000 --log-config log_config.json &