diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 69005b7731..b188129336 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -34,9 +34,9 @@ assignees: '' @@ -49,4 +49,4 @@ docker logs archery -f --tail=10 一般建议使用release版本,其他都是非稳定版本 - 应用版本/分支:Release v1.4.5 - 部署方式:Docker、手工部署 ---> \ No newline at end of file +--> diff --git a/README.md b/README.md index 2799c3364a..3263cf4239 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ docker restart archery #日志查看和问题排查 docker logs archery -f --tail=10 -/downloads/log/archery.log +logs/archery.log ``` #### 访问 diff --git a/archery/settings.py b/archery/settings.py index 0ef176c71a..ce3508e06d 100644 --- a/archery/settings.py +++ b/archery/settings.py @@ -211,7 +211,15 @@ 'default': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', - 'filename': 'downloads/log/archery.log', + 'filename': 'logs/archery.log', + 'maxBytes': 1024 * 1024 * 100, # 5 MB + 'backupCount': 5, + 'formatter': 'verbose', + }, + 'django-q': { + 'level': 'DEBUG', + 'class': 'logging.handlers.RotatingFileHandler', + 'filename': 'logs/qcluster.log', 'maxBytes': 1024 * 1024 * 100, # 5 MB 'backupCount': 5, 'formatter': 'verbose', @@ -228,7 +236,7 @@ 'level': 'DEBUG' }, 'django-q': { # django_q模块相关日志 - 'handlers': ['console', 'default'], + 'handlers': ['console', 'django-q'], 'level': 'DEBUG', 'propagate': False }, @@ -242,10 +250,10 @@ # 'level': 'DEBUG', # 'propagate': False # }, - 'django.request': { # 打印请求错误堆栈信息,方便开发 - 'handlers': ['console', 'default'], - 'level': 'DEBUG', - 'propagate': False - }, + # 'django.request': { # 打印请求错误堆栈信息,方便开发 + # 'handlers': ['console', 'default'], + # 'level': 'DEBUG', + # 'propagate': False + # }, } } diff --git a/downloads/log/.gitkeep b/logs/.gitkeep similarity index 100% rename from downloads/log/.gitkeep rename to logs/.gitkeep diff --git a/qcluster_supervisord.conf b/qcluster_supervisord.conf index a522cc71b5..9acf1dc1e2 100644 --- a/qcluster_supervisord.conf +++ b/qcluster_supervisord.conf @@ -1,9 +1,9 @@ [supervisord] -logfile=downloads/log/supervisord.log ; (main log file;default /supervisord.log) +logfile=logs/supervisord.log ; (main log file;default /supervisord.log) logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) logfile_backups=10 ; (num of main logfile rotation backups;default 10) loglevel=info ; (log level;default info; others: debug,warn,trace) -pidfile=downloads/log/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +pidfile=logs/supervisord.pid ; (supervisord pidfile;default supervisord.pid) nodaemon=false ; (start in foreground if true;default false) minfds=1024 ; (min. avail startup file descriptors;default 1024) minprocs=200 ; (min. avail process descriptors;default 200) diff --git a/sql/sql_workflow.py b/sql/sql_workflow.py index 28601b2243..c89742ef2a 100644 --- a/sql/sql_workflow.py +++ b/sql/sql_workflow.py @@ -215,6 +215,7 @@ def submit(request): except Exception as msg: logger.error(f"提交工单报错,错误信息:{traceback.format_exc()}") context = {'errMsg': msg} + logger.error(traceback.format_exc()) return render(request, 'error.html', context) else: # 自动审核通过才进行消息通知 diff --git a/src/charts/values.yaml b/src/charts/values.yaml index f579c74c85..32ebea07f9 100644 --- a/src/charts/values.yaml +++ b/src/charts/values.yaml @@ -339,7 +339,7 @@ configMap: 'default': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', - 'filename': 'downloads/log/archery.log', + 'filename': 'logs/archery.log', 'maxBytes': 1024 * 1024 * 100, # 5 MB 'backupCount': 5, 'formatter': 'verbose', @@ -391,7 +391,7 @@ configMap: trace: false # 日志级别,[0:Emergency, 1:Alert, 2:Critical, 3:Error, 4:Warning, 5:Notice, 6:Informational, 7:Debug] log-level: 3 - log-output: /opt/archery/downloads/log/soar.log + log-output: /opt/archery/logs/soar.log # 优化建议输出格式 report-type: markdown ignore-rules: diff --git a/src/docker-compose/archery/settings.py b/src/docker-compose/archery/settings.py index 2eba5720a0..260ff04e24 100644 --- a/src/docker-compose/archery/settings.py +++ b/src/docker-compose/archery/settings.py @@ -204,7 +204,7 @@ 'default': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', - 'filename': 'downloads/log/archery.log', + 'filename': 'logs/archery.log', 'maxBytes': 1024 * 1024 * 100, # 5 MB 'backupCount': 5, 'formatter': 'verbose', diff --git a/src/docker-compose/archery/soar.yaml b/src/docker-compose/archery/soar.yaml index 1f55c1c1a0..387f385021 100644 --- a/src/docker-compose/archery/soar.yaml +++ b/src/docker-compose/archery/soar.yaml @@ -11,7 +11,7 @@ profiling: false trace: false # 日志级别,[0:Emergency, 1:Alert, 2:Critical, 3:Error, 4:Warning, 5:Notice, 6:Informational, 7:Debug] log-level: 3 -log-output: /opt/archery/downloads/log/soar.log +log-output: /opt/archery/logs/soar.log # 优化建议输出格式 report-type: markdown ignore-rules: diff --git a/src/docker-compose/docker-compose.yml b/src/docker-compose/docker-compose.yml index 8c6dc60597..96d884df5e 100644 --- a/src/docker-compose/docker-compose.yml +++ b/src/docker-compose/docker-compose.yml @@ -52,6 +52,7 @@ services: - "./archery/docs.md:/opt/archery/docs/docs.md" - "./archery/downloads:/opt/archery/downloads" - "./archery/sql/migrations:/opt/archery/sql/migrations" + - "./archery/logs:/opt/archery/logs" entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh" environment: NGINX_PORT: 9123 diff --git a/src/plugins/soar.yaml b/src/plugins/soar.yaml index 72cbf18301..9cc98d320e 100644 --- a/src/plugins/soar.yaml +++ b/src/plugins/soar.yaml @@ -11,7 +11,7 @@ profiling: false trace: false # 日志级别,[0:Emergency, 1:Alert, 2:Critical, 3:Error, 4:Warning, 5:Notice, 6:Informational, 7:Debug] log-level: 7 -log-output: /opt/archery/downloads/log/soar.log +log-output: /opt/archery/logs/soar.log # 优化建议输出格式 report-type: markdown ignore-rules: @@ -43,4 +43,4 @@ explain-warn-scalability: query: "" list-heuristic-rules: false list-test-sqls: false -verbose: true \ No newline at end of file +verbose: true