From 302f49baf2acc23e6ea5da9778eeb18ad97c444c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 8 Nov 2018 10:12:33 +0100 Subject: provide a function to log to syslog --- include/text.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 15cc0ca8a..076c98407 100644 --- a/include/text.php +++ b/include/text.php @@ -633,6 +633,19 @@ function attribute_contains($attr, $s) { return false; } +/** + * @brief Log to syslog + * + * @param string $msg Message to log + * @param int $priority - compatible with syslog + */ +function hz_syslog($msg, $priority = LOG_INFO) { + openlog("hz-log", LOG_PID | LOG_PERROR, LOG_LOCAL0); + syslog($priority, $msg); + closelog(); +} + + /** * @brief Logging function for Hubzilla. * -- cgit v1.2.3