aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-24 21:26:46 +0000
committerMario <mario@mariovavti.com>2020-10-24 21:26:46 +0000
commit5580fc1954a63f861644e2de3773fbb3adfa8f2c (patch)
tree193bc866d62a6d396e79e5e8556007514456a8d8 /include/text.php
parentd0e85f05afd09258f8e390811d4c727027a5c1a7 (diff)
downloadvolse-hubzilla-5580fc1954a63f861644e2de3773fbb3adfa8f2c.tar.gz
volse-hubzilla-5580fc1954a63f861644e2de3773fbb3adfa8f2c.tar.bz2
volse-hubzilla-5580fc1954a63f861644e2de3773fbb3adfa8f2c.zip
enable btlogging to syslog
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index ec397910d..237202283 100644
--- a/include/text.php
+++ b/include/text.php
@@ -723,7 +723,7 @@ function logid() {
* @param int $level A log level
* @param int $priority - compatible with syslog
*/
-function btlogger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) {
+function btlogger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO, $syslog = false) {
if(! defined('BTLOGGER_DEBUG_FILE'))
define('BTLOGGER_DEBUG_FILE','btlogger.out');
@@ -742,7 +742,9 @@ function btlogger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) {
for($x = 1; $x < count($stack); $x ++) {
$s = 'stack: ' . basename($stack[$x]['file']) . ':' . $stack[$x]['line'] . ':' . $stack[$x]['function'] . '()';
logger($s,$level, $priority);
-
+ if($syslog) {
+ hz_syslog(print_r($s,true));
+ }
if(file_exists(BTLOGGER_DEBUG_FILE) && is_writable(BTLOGGER_DEBUG_FILE)) {
@file_put_contents(BTLOGGER_DEBUG_FILE, $s . PHP_EOL, FILE_APPEND);
}