mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
dev: enable global level log settings
This commit is contained in:
parent
edb4280ec1
commit
8d4e4a7485
1
.gitignore
vendored
1
.gitignore
vendored
@ -51,6 +51,7 @@ staticfiles
|
|||||||
mediafiles
|
mediafiles
|
||||||
.env
|
.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
logs/
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
assets/dist/
|
assets/dist/
|
||||||
|
@ -215,3 +215,46 @@ CELERY_TIMEZONE = TIME_ZONE
|
|||||||
CELERY_TASK_SERIALIZER = 'json'
|
CELERY_TASK_SERIALIZER = 'json'
|
||||||
CELERY_ACCEPT_CONTENT = ['application/json']
|
CELERY_ACCEPT_CONTENT = ['application/json']
|
||||||
CELERY_IMPORTS = ("plane.bgtasks.issue_automation_task","plane.bgtasks.exporter_expired_task")
|
CELERY_IMPORTS = ("plane.bgtasks.issue_automation_task","plane.bgtasks.exporter_expired_task")
|
||||||
|
|
||||||
|
LOG_DIR = os.path.join(BASE_DIR, 'logs')
|
||||||
|
|
||||||
|
if not os.path.exists(LOG_DIR):
|
||||||
|
os.makedirs(LOG_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
LOGGING = {
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
"formatters": {
|
||||||
|
"verbose": {
|
||||||
|
"format": "{levelname} {asctime} {module} {process:d} {thread:d} {message}",
|
||||||
|
"style": "{",
|
||||||
|
},
|
||||||
|
"json": {
|
||||||
|
"()": "pythonjsonlogger.jsonlogger.JsonFormatter",
|
||||||
|
"fmt": "%(levelname)s %(asctime)s %(module)s %(name)s %(message)s",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"handlers": {
|
||||||
|
"console": {
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"formatter": "verbose",
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"class": "logging.handlers.TimedRotatingFileHandler",
|
||||||
|
"filename": os.path.join(BASE_DIR, 'logs', 'debug.log') if DEBUG else os.path.join(BASE_DIR, 'logs', 'error.log'),
|
||||||
|
"when": "midnight",
|
||||||
|
"interval": 1, # One day
|
||||||
|
"backupCount": 5, # Keep last 5 days of logs,
|
||||||
|
"formatter": "json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"plane": {
|
||||||
|
"level": "DEBUG" if DEBUG else "ERROR",
|
||||||
|
"handlers": ["console", "file"],
|
||||||
|
"propagate": False,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -125,39 +125,3 @@ OPENAI_API_BASE = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
|
|||||||
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", False)
|
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", False)
|
||||||
GPT_ENGINE = os.environ.get("GPT_ENGINE", "gpt-3.5-turbo")
|
GPT_ENGINE = os.environ.get("GPT_ENGINE", "gpt-3.5-turbo")
|
||||||
|
|
||||||
|
|
||||||
LOGGING = {
|
|
||||||
"version": 1,
|
|
||||||
"disable_existing_loggers": False,
|
|
||||||
"formatters": {
|
|
||||||
"verbose": {
|
|
||||||
"format": "{levelname} {asctime} {module} {process:d} {thread:d} {message}",
|
|
||||||
"style": "{",
|
|
||||||
},
|
|
||||||
"json": {
|
|
||||||
"()": "pythonjsonlogger.jsonlogger.JsonFormatter",
|
|
||||||
"fmt": "%(levelname)s %(asctime)s %(module)s %(name)s %(message)s",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"handlers": {
|
|
||||||
"console": {
|
|
||||||
"class": "logging.StreamHandler",
|
|
||||||
"formatter": "verbose",
|
|
||||||
},
|
|
||||||
"file": {
|
|
||||||
"class": "logging.handlers.TimedRotatingFileHandler",
|
|
||||||
"filename": "debug.log",
|
|
||||||
"when": "midnight",
|
|
||||||
"interval": 1, # One day
|
|
||||||
"backupCount": 5, # Keep last 5 days of logs,
|
|
||||||
"formatter": "json",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"loggers": {
|
|
||||||
"plane": {
|
|
||||||
"level": "ERROR",
|
|
||||||
"handlers": ["console", "file"],
|
|
||||||
"propagate": False,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
@ -87,6 +87,8 @@ services:
|
|||||||
command: ./bin/takeoff
|
command: ./bin/takeoff
|
||||||
deploy:
|
deploy:
|
||||||
replicas: ${API_REPLICAS:-1}
|
replicas: ${API_REPLICAS:-1}
|
||||||
|
volumes:
|
||||||
|
- logs/api:/code/plane/logs
|
||||||
depends_on:
|
depends_on:
|
||||||
- plane-db
|
- plane-db
|
||||||
- plane-redis
|
- plane-redis
|
||||||
@ -98,6 +100,8 @@ services:
|
|||||||
image: makeplane/plane-backend:${APP_RELEASE:-latest}
|
image: makeplane/plane-backend:${APP_RELEASE:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
command: ./bin/worker
|
command: ./bin/worker
|
||||||
|
volumes:
|
||||||
|
- logs/worker:/code/plane/logs
|
||||||
depends_on:
|
depends_on:
|
||||||
- api
|
- api
|
||||||
- plane-db
|
- plane-db
|
||||||
@ -110,6 +114,8 @@ services:
|
|||||||
image: makeplane/plane-backend:${APP_RELEASE:-latest}
|
image: makeplane/plane-backend:${APP_RELEASE:-latest}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
command: ./bin/beat
|
command: ./bin/beat
|
||||||
|
volumes:
|
||||||
|
- logs/beat-worker:/code/plane/logs
|
||||||
depends_on:
|
depends_on:
|
||||||
- api
|
- api
|
||||||
- plane-db
|
- plane-db
|
||||||
@ -166,3 +172,4 @@ volumes:
|
|||||||
pgdata:
|
pgdata:
|
||||||
redisdata:
|
redisdata:
|
||||||
uploads:
|
uploads:
|
||||||
|
logs:
|
||||||
|
Loading…
Reference in New Issue
Block a user