mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-06-05 05:13:48 +00:00
Log format (#704)
* Format c log * Format go log * Add SEAFILE_LOG_TO_STDOUT env * Modify parameters name * Set stdout to output * Add app name and print error log * Disable daemon mode when SEAFILE_LOG_TO_STDOUT is true --------- Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
parent
1afed5d770
commit
6af96fe1d2
38
common/log.c
38
common/log.c
@ -19,6 +19,8 @@ static int ccnet_log_level;
|
|||||||
static int seafile_log_level;
|
static int seafile_log_level;
|
||||||
static char *logfile;
|
static char *logfile;
|
||||||
static FILE *logfp;
|
static FILE *logfp;
|
||||||
|
static gboolean log_to_stdout = FALSE;
|
||||||
|
static char *app_name;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#ifdef SEAFILE_SERVER
|
#ifdef SEAFILE_SERVER
|
||||||
@ -40,6 +42,8 @@ get_syslog_level (GLogLevelFlags level)
|
|||||||
return LOG_WARNING;
|
return LOG_WARNING;
|
||||||
case G_LOG_LEVEL_ERROR:
|
case G_LOG_LEVEL_ERROR:
|
||||||
return LOG_ERR;
|
return LOG_ERR;
|
||||||
|
case G_LOG_LEVEL_CRITICAL:
|
||||||
|
return LOG_ERR;
|
||||||
default:
|
default:
|
||||||
return LOG_DEBUG;
|
return LOG_DEBUG;
|
||||||
}
|
}
|
||||||
@ -59,12 +63,26 @@ seafile_log (const gchar *log_domain, GLogLevelFlags log_level,
|
|||||||
if (log_level > seafile_log_level)
|
if (log_level > seafile_log_level)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (log_to_stdout) {
|
||||||
|
char name_buf[32] = {0};
|
||||||
|
snprintf(name_buf, sizeof(name_buf), "[%s] ", app_name);
|
||||||
|
fputs (name_buf, logfp);
|
||||||
|
}
|
||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
len = strftime (buf, 1024, "%Y-%m-%d %H:%M:%S ", tm);
|
len = strftime (buf, 1024, "[%Y-%m-%d %H:%M:%S] ", tm);
|
||||||
g_return_if_fail (len < 1024);
|
g_return_if_fail (len < 1024);
|
||||||
if (logfp) {
|
if (logfp) {
|
||||||
fputs (buf, logfp);
|
fputs (buf, logfp);
|
||||||
|
if (log_level == G_LOG_LEVEL_DEBUG)
|
||||||
|
fputs ("[DEBUG] ", logfp);
|
||||||
|
else if (log_level == G_LOG_LEVEL_WARNING)
|
||||||
|
fputs ("[WARNING] ", logfp);
|
||||||
|
else if (log_level == G_LOG_LEVEL_CRITICAL)
|
||||||
|
fputs ("[ERROR] ", logfp);
|
||||||
|
else
|
||||||
|
fputs ("[INFO] ", logfp);
|
||||||
fputs (message, logfp);
|
fputs (message, logfp);
|
||||||
fflush (logfp);
|
fflush (logfp);
|
||||||
}
|
}
|
||||||
@ -95,6 +113,14 @@ ccnet_log (const gchar *log_domain, GLogLevelFlags log_level,
|
|||||||
g_return_if_fail (len < 1024);
|
g_return_if_fail (len < 1024);
|
||||||
if (logfp) {
|
if (logfp) {
|
||||||
fputs (buf, logfp);
|
fputs (buf, logfp);
|
||||||
|
if (log_level == G_LOG_LEVEL_DEBUG)
|
||||||
|
fputs ("[DEBUG] ", logfp);
|
||||||
|
else if (log_level == G_LOG_LEVEL_WARNING)
|
||||||
|
fputs ("[WARNING] ", logfp);
|
||||||
|
else if (log_level == G_LOG_LEVEL_CRITICAL)
|
||||||
|
fputs ("[ERROR] ", logfp);
|
||||||
|
else
|
||||||
|
fputs ("[INFO] ", logfp);
|
||||||
fputs (message, logfp);
|
fputs (message, logfp);
|
||||||
fflush (logfp);
|
fflush (logfp);
|
||||||
}
|
}
|
||||||
@ -121,7 +147,7 @@ get_debug_level(const char *str, int default_level)
|
|||||||
|
|
||||||
int
|
int
|
||||||
seafile_log_init (const char *_logfile, const char *ccnet_debug_level_str,
|
seafile_log_init (const char *_logfile, const char *ccnet_debug_level_str,
|
||||||
const char *seafile_debug_level_str)
|
const char *seafile_debug_level_str, const char *_app_name)
|
||||||
{
|
{
|
||||||
g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
|
g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
|
||||||
| G_LOG_FLAG_RECURSION, seafile_log, NULL);
|
| G_LOG_FLAG_RECURSION, seafile_log, NULL);
|
||||||
@ -132,9 +158,13 @@ seafile_log_init (const char *_logfile, const char *ccnet_debug_level_str,
|
|||||||
ccnet_log_level = get_debug_level(ccnet_debug_level_str, G_LOG_LEVEL_INFO);
|
ccnet_log_level = get_debug_level(ccnet_debug_level_str, G_LOG_LEVEL_INFO);
|
||||||
seafile_log_level = get_debug_level(seafile_debug_level_str, G_LOG_LEVEL_DEBUG);
|
seafile_log_level = get_debug_level(seafile_debug_level_str, G_LOG_LEVEL_DEBUG);
|
||||||
|
|
||||||
if (strcmp(_logfile, "-") == 0) {
|
app_name = g_strdup (_app_name);
|
||||||
|
|
||||||
|
const char *log_to_stdout_env = g_getenv("SEAFILE_LOG_TO_STDOUT");
|
||||||
|
if (g_strcmp0(_logfile, "-") == 0 || g_strcmp0(log_to_stdout_env, "true") == 0) {
|
||||||
logfp = stdout;
|
logfp = stdout;
|
||||||
logfile = g_strdup (_logfile);
|
logfile = g_strdup (_logfile);
|
||||||
|
log_to_stdout = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logfile = ccnet_expand_path(_logfile);
|
logfile = ccnet_expand_path(_logfile);
|
||||||
@ -152,7 +182,7 @@ seafile_log_reopen ()
|
|||||||
{
|
{
|
||||||
FILE *fp, *oldfp;
|
FILE *fp, *oldfp;
|
||||||
|
|
||||||
if (strcmp(logfile, "-") == 0)
|
if (g_strcmp0(logfile, "-") == 0 || log_to_stdout)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((fp = g_fopen (logfile, "a+")) == NULL) {
|
if ((fp = g_fopen (logfile, "a+")) == NULL) {
|
||||||
|
@ -11,9 +11,13 @@
|
|||||||
#define seaf_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define seaf_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef seaf_error
|
||||||
|
#define seaf_error(fmt, ...) g_critical("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int seafile_log_init (const char *logfile, const char *ccnet_debug_level_str,
|
int seafile_log_init (const char *logfile, const char *ccnet_debug_level_str,
|
||||||
const char *seafile_debug_level_str);
|
const char *seafile_debug_level_str, const char *_app_name);
|
||||||
int seafile_log_reopen ();
|
int seafile_log_reopen ();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
@ -203,7 +203,6 @@ start_seaf_server ()
|
|||||||
"-P", ctl->pidfile[PID_SERVER],
|
"-P", ctl->pidfile[PID_SERVER],
|
||||||
"-p", ctl->rpc_pipe_path,
|
"-p", ctl->rpc_pipe_path,
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
int pid = spawn_process (argv, false);
|
int pid = spawn_process (argv, false);
|
||||||
if (pid <= 0) {
|
if (pid <= 0) {
|
||||||
seaf_warning ("Failed to spawn seaf-server\n");
|
seaf_warning ("Failed to spawn seaf-server\n");
|
||||||
@ -568,8 +567,8 @@ seaf_controller_init (SeafileController *ctl,
|
|||||||
char *topdir = g_path_get_dirname(config_dir);
|
char *topdir = g_path_get_dirname(config_dir);
|
||||||
logdir = g_build_filename (topdir, "logs", NULL);
|
logdir = g_build_filename (topdir, "logs", NULL);
|
||||||
if (checkdir_with_mkdir(logdir) < 0) {
|
if (checkdir_with_mkdir(logdir) < 0) {
|
||||||
fprintf (stderr, "failed to create log folder \"%s\": %s\n",
|
seaf_error ("failed to create log folder \"%s\": %s\n",
|
||||||
logdir, strerror(errno));
|
logdir, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
g_free (topdir);
|
g_free (topdir);
|
||||||
@ -684,11 +683,11 @@ static void
|
|||||||
usage ()
|
usage ()
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Usage: seafile-controller OPTIONS\n"
|
fprintf (stderr, "Usage: seafile-controller OPTIONS\n"
|
||||||
"OPTIONS:\n"
|
"OPTIONS:\n"
|
||||||
" -b, --bin-dir insert a directory in front of the PATH env\n"
|
" -b, --bin-dir insert a directory in front of the PATH env\n"
|
||||||
" -c, --config-dir ccnet config dir\n"
|
" -c, --config-dir ccnet config dir\n"
|
||||||
" -d, --seafile-dir seafile dir\n"
|
" -d, --seafile-dir seafile dir\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* seafile-controller -t is used to test whether config file is valid */
|
/* seafile-controller -t is used to test whether config file is valid */
|
||||||
@ -717,9 +716,8 @@ test_config (const char *central_config_dir,
|
|||||||
&error);
|
&error);
|
||||||
|
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
fprintf (stderr,
|
seaf_error ("failed to run \"seaf-server -t\": %s\n",
|
||||||
"failed to run \"seaf-server -t\": %s\n",
|
error->message);
|
||||||
error->message);
|
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,8 +730,7 @@ test_config (const char *central_config_dir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (retcode != 0) {
|
if (retcode != 0) {
|
||||||
fprintf (stderr,
|
seaf_error ("failed to run \"seaf-server -t\" [%d]\n", retcode);
|
||||||
"failed to run \"seaf-server -t\" [%d]\n", retcode);
|
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -870,6 +867,7 @@ int main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf (stderr, "seafile-controller version 1.0\n");
|
fprintf (stderr, "seafile-controller version 1.0\n");
|
||||||
|
exit(1);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
test_conf = TRUE;
|
test_conf = TRUE;
|
||||||
@ -936,8 +934,8 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
char *logfile = g_build_filename (ctl->logdir, "controller.log", NULL);
|
char *logfile = g_build_filename (ctl->logdir, "controller.log", NULL);
|
||||||
if (seafile_log_init (logfile, ccnet_debug_level_str,
|
if (seafile_log_init (logfile, ccnet_debug_level_str,
|
||||||
seafile_debug_level_str) < 0) {
|
seafile_debug_level_str, "seafile-controller") < 0) {
|
||||||
seaf_warning ("Failed to init log.\n");
|
fprintf (stderr, "Failed to init log.\n");
|
||||||
controller_exit (1);
|
controller_exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -952,6 +950,11 @@ int main (int argc, char **argv)
|
|||||||
if (seaf_controller_start () < 0)
|
if (seaf_controller_start () < 0)
|
||||||
controller_exit (1);
|
controller_exit (1);
|
||||||
|
|
||||||
|
const char *log_to_stdout_env = g_getenv("SEAFILE_LOG_TO_STDOUT");
|
||||||
|
if (g_strcmp0(log_to_stdout_env, "true") == 0) {
|
||||||
|
daemon_mode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (daemon_mode) {
|
if (daemon_mode) {
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
@ -44,6 +44,8 @@ var logFp *os.File
|
|||||||
var dbType string
|
var dbType string
|
||||||
var seafileDB, ccnetDB *sql.DB
|
var seafileDB, ccnetDB *sql.DB
|
||||||
|
|
||||||
|
var logToStdout bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.StringVar(¢ralDir, "F", "", "central config directory")
|
flag.StringVar(¢ralDir, "F", "", "central config directory")
|
||||||
flag.StringVar(&dataDir, "d", "", "seafile data directory")
|
flag.StringVar(&dataDir, "d", "", "seafile data directory")
|
||||||
@ -51,6 +53,11 @@ func init() {
|
|||||||
flag.StringVar(&rpcPipePath, "p", "", "rpc pipe path")
|
flag.StringVar(&rpcPipePath, "p", "", "rpc pipe path")
|
||||||
flag.StringVar(&pidFilePath, "P", "", "pid file path")
|
flag.StringVar(&pidFilePath, "P", "", "pid file path")
|
||||||
|
|
||||||
|
env := os.Getenv("SEAFILE_LOG_TO_STDOUT")
|
||||||
|
if env == "true" {
|
||||||
|
logToStdout = true
|
||||||
|
}
|
||||||
|
|
||||||
log.SetFormatter(&LogFormatter{})
|
log.SetFormatter(&LogFormatter{})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,8 +68,23 @@ const (
|
|||||||
type LogFormatter struct{}
|
type LogFormatter struct{}
|
||||||
|
|
||||||
func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error) {
|
func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error) {
|
||||||
buf := make([]byte, 0, len(timestampFormat)+len(entry.Message)+1)
|
levelStr := entry.Level.String()
|
||||||
|
if levelStr == "fatal" {
|
||||||
|
levelStr = "ERROR"
|
||||||
|
} else {
|
||||||
|
levelStr = strings.ToUpper(levelStr)
|
||||||
|
}
|
||||||
|
level := fmt.Sprintf("[%s] ", levelStr)
|
||||||
|
appName := ""
|
||||||
|
if logToStdout {
|
||||||
|
appName = "[fileserver] "
|
||||||
|
}
|
||||||
|
buf := make([]byte, 0, len(appName)+len(timestampFormat)+len(level)+len(entry.Message)+1)
|
||||||
|
if logToStdout {
|
||||||
|
buf = append(buf, appName...)
|
||||||
|
}
|
||||||
buf = entry.Time.AppendFormat(buf, timestampFormat)
|
buf = entry.Time.AppendFormat(buf, timestampFormat)
|
||||||
|
buf = append(buf, level...)
|
||||||
buf = append(buf, entry.Message...)
|
buf = append(buf, entry.Message...)
|
||||||
buf = append(buf, '\n')
|
buf = append(buf, '\n')
|
||||||
return buf, nil
|
return buf, nil
|
||||||
@ -320,7 +342,9 @@ func main() {
|
|||||||
loadSeafileDB()
|
loadSeafileDB()
|
||||||
option.LoadFileServerOptions(centralDir)
|
option.LoadFileServerOptions(centralDir)
|
||||||
|
|
||||||
if logFile == "" {
|
if logToStdout {
|
||||||
|
// Use default output (StdOut)
|
||||||
|
} else if logFile == "" {
|
||||||
absLogFile = filepath.Join(absDataDir, "fileserver.log")
|
absLogFile = filepath.Join(absDataDir, "fileserver.log")
|
||||||
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -420,6 +444,9 @@ func handleUser1Signal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logRotate() {
|
func logRotate() {
|
||||||
|
if logToStdout {
|
||||||
|
return
|
||||||
|
}
|
||||||
// reopen fileserver log
|
// reopen fileserver log
|
||||||
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
fp, err := os.OpenFile(absLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -319,8 +319,8 @@ int main(int argc, char *argv[])
|
|||||||
logfile = options.log_file;
|
logfile = options.log_file;
|
||||||
|
|
||||||
if (seafile_log_init(logfile, ccnet_debug_level_str,
|
if (seafile_log_init(logfile, ccnet_debug_level_str,
|
||||||
seafile_debug_level_str) < 0) {
|
seafile_debug_level_str, "seaf-fuse") < 0) {
|
||||||
fprintf(stderr, "Failed to init log.\n");
|
fprintf (stderr, "Failed to init log.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,8 @@ static const struct option long_opts[] = {
|
|||||||
|
|
||||||
static void usage ()
|
static void usage ()
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr, "usage: seaf-fsck [-r] [-E exported_path] [-c config_dir] [-d seafile_dir] "
|
||||||
"usage: seaf-fsck [-r] [-E exported_path] [-c config_dir] [-d seafile_dir] "
|
"[repo_id_1 [repo_id_2 ...]]\n");
|
||||||
"[repo_id_1 [repo_id_2 ...]]\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -141,8 +140,8 @@ main(int argc, char *argv[])
|
|||||||
g_type_init();
|
g_type_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (seafile_log_init ("-", "info", "debug") < 0) {
|
if (seafile_log_init ("-", "info", "debug", "seaf-fsck") < 0) {
|
||||||
seaf_warning ("Failed to init log.\n");
|
fprintf (stderr, "Failed to init log.\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,14 +31,13 @@ static const struct option long_opts[] = {
|
|||||||
|
|
||||||
static void usage ()
|
static void usage ()
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr, "usage: seafserv-gc [-c config_dir] [-d seafile_dir] "
|
||||||
"usage: seafserv-gc [-c config_dir] [-d seafile_dir] "
|
"[repo_id_1 [repo_id_2 ...]]\n"
|
||||||
"[repo_id_1 [repo_id_2 ...]]\n"
|
"Additional options:\n"
|
||||||
"Additional options:\n"
|
"-r, --rm-deleted: remove garbaged repos\n"
|
||||||
"-r, --rm-deleted: remove garbaged repos\n"
|
"-R, --rm-fs: remove fs object\n"
|
||||||
"-R, --rm-fs: remove fs object\n"
|
"-D, --dry-run: report blocks that can be remove, but not remove them\n"
|
||||||
"-D, --dry-run: report blocks that can be remove, but not remove them\n"
|
"-V, --verbose: verbose output messages\n");
|
||||||
"-V, --verbose: verbose output messages\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -122,8 +121,8 @@ main(int argc, char *argv[])
|
|||||||
g_type_init();
|
g_type_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (seafile_log_init ("-", "info", "debug") < 0) {
|
if (seafile_log_init ("-", "info", "debug", "seafserv-gc") < 0) {
|
||||||
seaf_warning ("Failed to init log.\n");
|
fprintf (stderr, "Failed to init log.\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1186,10 +1186,7 @@ test_seafile_config(const char *central_config_dir, const char *config_dir, cons
|
|||||||
central_config_dir = ccnet_expand_path (central_config_dir);
|
central_config_dir = ccnet_expand_path (central_config_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seafile_log_init ("-", "debug", "debug") < 0) {
|
seafile_log_init ("-", "debug", "debug", "seaf-server");
|
||||||
fprintf (stderr, "seafile_log_init error: %s\n", strerror(errno));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
srand (time(NULL));
|
srand (time(NULL));
|
||||||
|
|
||||||
@ -1197,7 +1194,7 @@ test_seafile_config(const char *central_config_dir, const char *config_dir, cons
|
|||||||
|
|
||||||
seaf = seafile_session_new (central_config_dir, seafile_dir, config_dir, NULL, NULL);
|
seaf = seafile_session_new (central_config_dir, seafile_dir, config_dir, NULL, NULL);
|
||||||
if (!seaf) {
|
if (!seaf) {
|
||||||
fprintf (stderr, "Error: failed to create ccnet session\n");
|
seaf_error ("Error: failed to create ccnet session\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1280,6 +1277,11 @@ main (int argc, char **argv)
|
|||||||
return test_seafile_config (central_config_dir, ccnet_dir, seafile_dir);
|
return test_seafile_config (central_config_dir, ccnet_dir, seafile_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *log_to_stdout_env = g_getenv("SEAFILE_LOG_TO_STDOUT");
|
||||||
|
if (g_strcmp0 (log_to_stdout_env, "true") == 0) {
|
||||||
|
daemon_mode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (daemon_mode) {
|
if (daemon_mode) {
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
@ -1325,7 +1327,7 @@ main (int argc, char **argv)
|
|||||||
if (logfile == NULL)
|
if (logfile == NULL)
|
||||||
logfile = g_build_filename (seafile_dir, "seafile.log", NULL);
|
logfile = g_build_filename (seafile_dir, "seafile.log", NULL);
|
||||||
|
|
||||||
if (seafile_log_init (logfile, "info", "debug") < 0) {
|
if (seafile_log_init (logfile, "info", "debug", "seaf-server") < 0) {
|
||||||
seaf_warning ("Failed to init log.\n");
|
seaf_warning ("Failed to init log.\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user