aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-24 21:26:46 +0000
committerMario <mario@mariovavti.com>2020-10-24 23:29:11 +0200
commitd3d5ddfb434555373b892e127ad9faa6425af3bf (patch)
tree20375c26a8e9e142b6e28e2df2d551655cac48f3
parentc136741db65b65c33b3579c7d2a952d3b509e10e (diff)
downloadvolse-hubzilla-d3d5ddfb434555373b892e127ad9faa6425af3bf.tar.gz
volse-hubzilla-d3d5ddfb434555373b892e127ad9faa6425af3bf.tar.bz2
volse-hubzilla-d3d5ddfb434555373b892e127ad9faa6425af3bf.zip
enable btlogging to syslog
(cherry picked from commit 5580fc1954a63f861644e2de3773fbb3adfa8f2c)
-rw-r--r--Zotlabs/Lib/Webfinger.php2
-rw-r--r--Zotlabs/Lib/Zotfinger.php2
-rw-r--r--include/text.php6
3 files changed, 6 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Webfinger.php b/Zotlabs/Lib/Webfinger.php
index c2364ac4d..611c36889 100644
--- a/Zotlabs/Lib/Webfinger.php
+++ b/Zotlabs/Lib/Webfinger.php
@@ -106,4 +106,4 @@ class Webfinger {
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Lib/Zotfinger.php b/Zotlabs/Lib/Zotfinger.php
index 2d2e6796b..722e34dfc 100644
--- a/Zotlabs/Lib/Zotfinger.php
+++ b/Zotlabs/Lib/Zotfinger.php
@@ -60,4 +60,4 @@ class Zotfinger {
-} \ No newline at end of file
+}
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);
}