winlin

default write log to file.

... ... @@ -21,8 +21,10 @@ ff_log_dir ./objs/logs;
# the log tank, console or file.
# if console, print log to console.
# if file, write log to file. requires srs_log_file if log to file.
# default: console.
srs_log_tank console;
# default: file.
srs_log_tank file;
# when srs_log_tank is file, specifies the log file.
# default: ./objs/srs.log
srs_log_file ./objs/srs.log;
# the max connections.
# if exceed the max connections, server will drop the new connection.
... ...
... ... @@ -1282,7 +1282,7 @@ string SrsConfig::get_srs_log_file()
SrsConfDirective* conf = root->get("srs_log_file");
if (!conf || conf->arg0().empty()) {
return "";
return "./objs/srs.log";
}
return conf->arg0();
... ... @@ -1293,11 +1293,11 @@ bool SrsConfig::get_srs_log_tank_file()
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == "file") {
return true;
if (conf && conf->arg0() == "console") {
return false;
}
return false;
return true;
}
bool SrsConfig::get_deamon()
... ...
... ... @@ -61,6 +61,10 @@ int run_master()
signal(SIGTERM, handler);
signal(SIGINT, handler);
if ((ret = _srs_server->acquire_pid_file()) != ERROR_SUCCESS) {
return ret;
}
if ((ret = _srs_server->initialize_st()) != ERROR_SUCCESS) {
return ret;
}
... ... @@ -161,9 +165,5 @@ int main(int argc, char** argv)
return ret;
}
if ((ret = _srs_server->acquire_pid_file()) != ERROR_SUCCESS) {
return ret;
}
return run();
}
... ...