diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-11-08 10:12:33 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-11-08 10:12:33 +0100 |
commit | 302f49baf2acc23e6ea5da9778eeb18ad97c444c (patch) | |
tree | 9be3e7949766e09df55bb9e0ced7e01ea3d99aa8 /include/text.php | |
parent | c23dfa0d23ea479fc51ba27f948c1f4ee88e6c49 (diff) | |
download | volse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.tar.gz volse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.tar.bz2 volse-hubzilla-302f49baf2acc23e6ea5da9778eeb18ad97c444c.zip |
provide a function to log to syslog
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 13 |
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 |