mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-31 22:16:49 +00:00
fix(userspace/falco): remove syslog on windows
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
This commit is contained in:
parent
00a87234ce
commit
af70b4e770
@ -144,6 +144,7 @@ void falco_logger::log(int priority, const std::string&& msg)
|
||||
|
||||
std::string copy = msg;
|
||||
|
||||
#ifndef _WIN32
|
||||
if (falco_logger::log_syslog)
|
||||
{
|
||||
// Syslog output should not have any trailing newline
|
||||
@ -154,6 +155,7 @@ void falco_logger::log(int priority, const std::string&& msg)
|
||||
|
||||
::syslog(priority, "%s", copy.c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (falco_logger::log_stderr)
|
||||
{
|
||||
|
@ -18,7 +18,18 @@ limitations under the License.
|
||||
#pragma once
|
||||
|
||||
#include "sinsp.h"
|
||||
#ifdef _WIN32
|
||||
#define LOG_EMERG 0
|
||||
#define LOG_ALERT 1
|
||||
#define LOG_CRIT 2
|
||||
#define LOG_ERR 3
|
||||
#define LOG_WARNING 4
|
||||
#define LOG_NOTICE 5
|
||||
#define LOG_INFO 6
|
||||
#define LOG_DEBUG 7
|
||||
#else
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
class falco_logger
|
||||
{
|
||||
|
@ -16,10 +16,14 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
#include "outputs_syslog.h"
|
||||
#ifndef _WIN32
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
void falco::outputs::output_syslog::output(const message *msg)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
// Syslog output should not have any trailing newline
|
||||
::syslog(msg->priority, "%s", msg->msg.c_str());
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user