default write log to file.

pull/133/head
winlin 11 years ago
parent 76290a5a12
commit ed20bd7078

@ -21,8 +21,10 @@ ff_log_dir ./objs/logs;
# the log tank, console or file. # the log tank, console or file.
# if console, print log to console. # if console, print log to console.
# if file, write log to file. requires srs_log_file if log to file. # if file, write log to file. requires srs_log_file if log to file.
# default: console. # default: file.
srs_log_tank console; srs_log_tank file;
# when srs_log_tank is file, specifies the log file.
# default: ./objs/srs.log
srs_log_file ./objs/srs.log; srs_log_file ./objs/srs.log;
# the max connections. # the max connections.
# if exceed the max connections, server will drop the new connection. # 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"); SrsConfDirective* conf = root->get("srs_log_file");
if (!conf || conf->arg0().empty()) { if (!conf || conf->arg0().empty()) {
return ""; return "./objs/srs.log";
} }
return conf->arg0(); return conf->arg0();
@ -1293,11 +1293,11 @@ bool SrsConfig::get_srs_log_tank_file()
srs_assert(root); srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_tank"); SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == "file") { if (conf && conf->arg0() == "console") {
return true; return false;
} }
return false; return true;
} }
bool SrsConfig::get_deamon() bool SrsConfig::get_deamon()

@ -61,6 +61,10 @@ int run_master()
signal(SIGTERM, handler); signal(SIGTERM, handler);
signal(SIGINT, handler); signal(SIGINT, handler);
if ((ret = _srs_server->acquire_pid_file()) != ERROR_SUCCESS) {
return ret;
}
if ((ret = _srs_server->initialize_st()) != ERROR_SUCCESS) { if ((ret = _srs_server->initialize_st()) != ERROR_SUCCESS) {
return ret; return ret;
} }
@ -161,9 +165,5 @@ int main(int argc, char** argv)
return ret; return ret;
} }
if ((ret = _srs_server->acquire_pid_file()) != ERROR_SUCCESS) {
return ret;
}
return run(); return run();
} }

Loading…
Cancel
Save