1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add srs_log_file to write log to file. change to 0.9.27

This commit is contained in:
winlin 2014-03-23 12:21:36 +08:00
parent 4ddb5256ac
commit d94b9f44b3
10 changed files with 76 additions and 10 deletions

View file

@ -684,6 +684,11 @@ int SrsConfig::parse_file(const char* filename)
// TODO: check http.
// TODO: check pid.
std::string filename = this->get_srs_log_file();
if (!filename.empty()) {
srs_trace("open log file %s and write to", filename.c_str());
}
return ret;
}
@ -1253,11 +1258,11 @@ string SrsConfig::get_engine_output(SrsConfDirective* engine)
return conf->arg0();
}
string SrsConfig::get_log_dir()
string SrsConfig::get_ffmpeg_log_dir()
{
srs_assert(root);
SrsConfDirective* conf = root->get("log_dir");
SrsConfDirective* conf = root->get("ff_log_dir");
if (!conf || conf->arg0().empty()) {
return "./objs/logs";
}
@ -1265,6 +1270,18 @@ string SrsConfig::get_log_dir()
return conf->arg0();
}
string SrsConfig::get_srs_log_file()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_file");
if (!conf || conf->arg0().empty()) {
return "";
}
return conf->arg0();
}
int SrsConfig::get_max_connections()
{
srs_assert(root);