Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
e9a51251
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e9a51251
编写于
8月 19, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
!534 Set stdout to None when start mindinsight in subprocess
Merge pull request !534 from ougongchang/fix_show_error
上级
6d9e7041
e13cceb0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
9 deletion
+13
-9
mindinsight/backend/config/gunicorn_conf.py
mindinsight/backend/config/gunicorn_conf.py
+3
-3
mindinsight/backend/run.py
mindinsight/backend/run.py
+8
-4
mindinsight/conf/constants.py
mindinsight/conf/constants.py
+1
-1
mindinsight/utils/log.py
mindinsight/utils/log.py
+1
-1
未找到文件。
mindinsight/backend/config/gunicorn_conf.py
浏览文件 @
e9a51251
...
...
@@ -32,10 +32,10 @@ timeout = 30
graceful_timeout
=
30
daemon
=
False
captureoutput
=
Tru
e
captureoutput
=
Fals
e
# write gunicorn default log to
stream
, and using mindinsight logger write gunicorn log to file.
accesslog
=
'-'
# write gunicorn default log to
devnull
, and using mindinsight logger write gunicorn log to file.
accesslog
=
os
.
devnull
def
on_starting
(
server
):
...
...
mindinsight/backend/run.py
浏览文件 @
e9a51251
...
...
@@ -199,14 +199,18 @@ class GunicornLogger(Logger):
"""Rewrite gunicorn default logger."""
def
__init__
(
self
,
cfg
):
self
.
access_log
=
setup_logger
(
'gunicorn'
,
'access'
)
self
.
error_log
=
setup_logger
(
'gunicorn'
,
'error
'
)
s
uper
(
GunicornLogger
,
self
).
__init__
(
cfg
)
self
.
cfg
=
cfg
self
.
access_log
=
setup_logger
(
'gunicorn'
,
'access'
,
formatter
=
'%(message)s
'
)
s
elf
.
error_log
=
setup_logger
(
'gunicorn'
,
'error'
,
formatter
=
self
.
error_fmt
)
access_log_path
=
_get_access_log_path
()
error_log_path
=
_get_error_log_path
()
os
.
chmod
(
access_log_path
,
stat
.
S_IREAD
|
stat
.
S_IWRITE
)
os
.
chmod
(
error_log_path
,
stat
.
S_IREAD
|
stat
.
S_IWRITE
)
def
now
(
self
):
"""return Log Format"""
return
time
.
strftime
(
'[%Y-%m-%d-%H:%M:%S %z]'
)
def
_get_all_ip_addresses
(
host
):
"""Get all the accessible IP address."""
...
...
@@ -255,7 +259,7 @@ def start():
shell
=
False
,
# Change stdout to DEVNULL to prevent broken pipe error when creating new processes.
stdin
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
stdout
=
None
,
stderr
=
subprocess
.
STDOUT
)
...
...
mindinsight/conf/constants.py
浏览文件 @
e9a51251
...
...
@@ -51,7 +51,7 @@ def _calc_default_max_processes_cnt():
LOG_FORMAT
=
'[%(levelname)s] MI(%(process)d:%(thread)d,%(processName)s):%(asctime)s '
\
'[%(filepath)s:%(lineno)d][%(sub_module)s] %(message)s'
GUNICORN_ACCESS_FORMAT
=
"'%(
h)s <%(r)s> %(s)s %(b)s <%(f)s> <%(a)s> %(D)s
'"
GUNICORN_ACCESS_FORMAT
=
"'%(
t)s %(h)s <%(r)s> %(s)s %(b)s <%(f)s> <%(a)s> %(L)s
'"
LOG_LEVEL
=
logging
.
INFO
# rotating max bytes, default is 50M
...
...
mindinsight/utils/log.py
浏览文件 @
e9a51251
...
...
@@ -189,7 +189,7 @@ def setup_logger(sub_module, log_name, **kwargs):
if
not
formatter
:
formatter
=
settings
.
LOG_FORMAT
if
kwargs
.
get
(
'console'
,
Tru
e
):
if
kwargs
.
get
(
'console'
,
Fals
e
):
console_handler
=
logging
.
StreamHandler
(
sys
.
stdout
)
console_handler
.
formatter
=
MindInsightFormatter
(
sub_module
,
formatter
)
logger
.
addHandler
(
console_handler
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录