Server: Add callback for logrotate

pull/1969/head
winlin 5 years ago
parent fa1ccaa9f2
commit 2bc6632a22

@ -1104,6 +1104,11 @@ void SrsServer::on_signal(int signo)
#ifndef SRS_GPERF_MC
if (signo == SRS_SIGNAL_REOPEN_LOG) {
_srs_log->reopen();
if (handler) {
handler->on_logrotate();
}
srs_warn("reopen log file, signo=%d", signo);
return;
}

@ -236,6 +236,8 @@ public:
virtual srs_error_t on_cycle() = 0;
// Callback the handler when got client.
virtual srs_error_t on_accept_client(int max, int cur) = 0;
// Callback for logrotate.
virtual void on_logrotate() = 0;
};
// SRS RTMP server, initialize and listen, start connection service thread, destroy client.

Loading…
Cancel
Save