}
if (g_conf()->mon_cluster_log_to_file) {
+ if (this->log_rotated.exchange(false)) {
+ this->log_external_close_fds();
+ }
+
auto p = channel_fds.find(channel);
int fd;
if (p == channel_fds.end()) {
#ifndef CEPH_LOGMONITOR_H
#define CEPH_LOGMONITOR_H
+#include <atomic>
#include <map>
#include <set>
std::map<std::string, int> channel_fds;
fmt::memory_buffer file_log_buffer;
+ std::atomic<bool> log_rotated = false;
struct log_channel_info {
void check_subs();
void check_sub(Subscription *s);
+ void reopen_logs() {
+ this->log_rotated.store(true);
+ }
void log_external_close_fds();
void log_external(const LogEntry& le);
void log_external_backlog();
derr << "*** Got Signal " << sig_str(signum) << " ***" << dendl;
if (signum == SIGHUP) {
sighup_handler(signum);
+ logmon()->reopen_logs();
} else {
ceph_assert(signum == SIGINT || signum == SIGTERM);
shutdown();