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

Log: Support write log to tencentcloud CLS. v5.0.44

This commit is contained in:
winlin 2022-08-07 12:11:37 +08:00
parent 3da0b57121
commit 95cd0e84eb
15 changed files with 1631 additions and 7 deletions

View file

@ -12,6 +12,7 @@
#include <srs_protocol_st.hpp>
#include <srs_app_utility.hpp>
#include <srs_app_dvr.hpp>
#include <srs_app_tencentcloud.hpp>
using namespace std;
@ -180,6 +181,11 @@ srs_error_t SrsHybridServer::initialize()
return srs_error_wrap(err, "dvr async");
}
// Initialize TencentCloud CLS object.
if ((err = _srs_cls->initialize()) != srs_success) {
return srs_error_wrap(err, "cls client");
}
// Register some timers.
timer20ms_->subscribe(clock_monitor_);
timer5s_->subscribe(this);
@ -384,6 +390,12 @@ srs_error_t SrsHybridServer::on_timer(srs_utime_t interval)
thread_desc.c_str(), free_desc.c_str(), objs_desc.c_str()
);
// Report logs to CLS if enabled.
if ((err = srs_cls_report()) != srs_success) {
srs_warn("ignore cls err %s", srs_error_desc(err).c_str());
srs_freep(err);
}
return err;
}