added syslog

This commit is contained in:
wt committed 2024-07-03 10:05:16 +07:00
1 parent 829a98d76b
commit f2c3880982
14 files changed
+55 -4

No files matched your search

+2
View File
@@ -3,6 +3,7 @@
#include <json.hpp>
#include "../../routes.hpp"
#include "../../types.hpp"
#include <syslog.h>
void get_local_domains(const httplib::Request &request, httplib::Response &response) {
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
@@ -92,6 +93,7 @@ void set_local_domains(const httplib::Request &request, httplib::Response &respo
}
domainsfile.close();
system("/etc/init.d/dnsmasq restart");
syslog(LOG_INFO, "DNS local domains changed");
std::string responsedata = R"({"success":"true"})";
response.set_content(responsedata, JSON_TYPE);
}