mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
default write log to file.
This commit is contained in:
parent
76290a5a12
commit
ed20bd7078
3 changed files with 12 additions and 10 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue