aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-11-08 10:12:33 +0100
committerMario Vavti <mario@mariovavti.com>2018-11-08 10:12:33 +0100
commit302f49baf2acc23e6ea5da9778eeb18ad97c444c (patch)
tree9be3e7949766e09df55bb9e0ced7e01ea3d99aa8 /include
parentc23dfa0d23ea479fc51ba27f948c1f4ee88e6c49 (diff)
downloadvolse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.tar.gz
volse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.tar.bz2
volse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.zip
provide a function to log to syslog
Diffstat (limited to 'include')
-rw-r--r--include/text.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 15cc0ca8a..076c98407 100644
--- a/include/text.php
+++ b/include/text.php
@@ -634,6 +634,19 @@ function attribute_contains($attr, $s) {
}
/**
+ * @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.
*
* Logging output is configured through Hubzilla's system config. The log file