-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log format #704
Log format #704
Conversation
common/log.c
Outdated
@@ -59,12 +62,24 @@ seafile_log (const gchar *log_domain, GLogLevelFlags log_level, | |||
if (log_level > seafile_log_level) | |||
return; | |||
|
|||
if (log_to_stdout) { | |||
fputs ("[seaf-server] ", logfp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该在 seafile_log_init 函数增加一个参数(第一个参数),用于指定组件的名称,因为需要区分 seaf-server, seaf-fuse, controller 三个组件的日志的。还有 slow log 也有自己的日志名称。
controller/seafile-controller.c
Outdated
@@ -202,6 +202,7 @@ start_seaf_server () | |||
"-l", logfile, | |||
"-P", ctl->pidfile[PID_SERVER], | |||
"-p", ctl->rpc_pipe_path, | |||
"-f", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controller 和 seaf-server 应该在检测到 SEAFILE_LOG_TO_STDOUT 这个环境变量之后,主动禁用 daemon mode。这里不应该直接禁用 daemon mode,因为会影响非 docker 部署的用户。docker 部署下,应该是不需要 daemon mode 的,因为容器会一直运行。
controller/seafile-controller.c
Outdated
if (seafile_log_init (logfile, ccnet_debug_level_str, | ||
seafile_debug_level_str) < 0) { | ||
seafile_log_init ("-", ccnet_debug_level_str, seafile_debug_level_str); | ||
seaf_error ("Failed to init log.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在 seafile_log_init 之前的日志,就用 printf 输出就行了,这些都是些参数错误,在生产环境是不会出现的,所以不重要。其他几个组件也不需要改这些日志的输出了。
server/gc/seafserv-gc.c
Outdated
"-r, --rm-deleted: remove garbaged repos\n" | ||
"-R, --rm-fs: remove fs object\n" | ||
"-D, --dry-run: report blocks that can be remove, but not remove them\n" | ||
"-V, --verbose: verbose output messages\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gc 和 fsck 的 usage 日志不用改了。
controller/seafile-controller.c
Outdated
"-l", logfile, | ||
"-P", ctl->pidfile[PID_SERVER], | ||
"-p", ctl->rpc_pipe_path, | ||
"-f", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我之前的意思是,seaf-server, controller 这些会一直运行的程序,应该在检测到 SEAFILE_LOG_TO_STDOUT 之后,主动禁用掉 daemon mode,不理会输入的 -f 参数。不是在 controller 启动他们的时候通过 -f 参数控制。
No description provided.