log/config/native-syslog/native_syslog.cpp
Andrey Semashev 299603ff02 Fixed auto-detection of native syslog API.
The auto-detection was removed in 1.62, which resulted in UDP socket-based implementation being always used. The new auto-detection verifies the presence of syslog.h and all required components it provides.

Fixes ticket #12600.
2016-11-10 19:46:52 +03:00

27 lines
783 B
C++

/*
* Copyright Andrey Semashev 2016.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#include <syslog.h>
int main(int, char*[])
{
::openlog("test", LOG_NDELAY, LOG_USER);
::syslog(LOG_USER | LOG_DEBUG, "debug message");
::syslog(LOG_USER | LOG_INFO, "info message");
::syslog(LOG_USER | LOG_NOTICE, "notice message");
::syslog(LOG_USER | LOG_WARNING, "warning message");
::syslog(LOG_USER | LOG_ERR, "error message");
::syslog(LOG_USER | LOG_CRIT, "critical message");
::syslog(LOG_USER | LOG_ALERT, "alert message");
::syslog(LOG_USER | LOG_EMERG, "emergency message");
::closelog();
return 0;
}