diff --git a/www/lib/CoreLibs/ACL/Login.php b/www/lib/CoreLibs/ACL/Login.php
index 89374521..79c291c7 100644
--- a/www/lib/CoreLibs/ACL/Login.php
+++ b/www/lib/CoreLibs/ACL/Login.php
@@ -120,11 +120,11 @@ class Login extends \CoreLibs\DB\IO
*/
public function __construct(array $db_config)
{
- // log login data for this class only
- $this->log->setLogPer('class', true);
-
// create db connection and init base class
parent::__construct($db_config);
+ // log login data for this class only
+ $this->log->setLogPer('class', true);
+ // set db special errors
if ($this->db_init_error === true) {
echo 'Could not connect to DB
';
// if I can't connect to the DB to auth exit hard. No access allowed
diff --git a/www/lib/CoreLibs/Debug/Logging.php b/www/lib/CoreLibs/Debug/Logging.php
index c47443f2..54e4c079 100644
--- a/www/lib/CoreLibs/Debug/Logging.php
+++ b/www/lib/CoreLibs/Debug/Logging.php
@@ -229,8 +229,8 @@ class Logging
$rpl_string = !$this->log_per_level ? '' : '_'.$level; // if request to write to one file
$fn = str_replace('##LEVEL##', $rpl_string, $fn); // create output filename
-
- $rpl_string = !$this->log_per_class ? '' : '_'.str_replace('\\', '-', get_class($this)); // set sub class settings
+ // set per class, but don't use get_class as we will only get self
+ $rpl_string = !$this->log_per_class ? '' : '_'.str_replace('\\', '-', \CoreLibs\Debug\Support::getCallerClass()); // set sub class settings
$fn = str_replace('##CLASS##', $rpl_string, $fn); // create output filename
$rpl_string = !$this->log_per_page ? '' : '_'.\CoreLibs\Get\System::getPageName(1); // if request to write to one file
@@ -252,6 +252,19 @@ class Logging
return true;
}
+ /**
+ * Superseeded by \CoreLibs\Debug\Support::getCallerClass() calls
+ *
+ * @return string Class name where called
+ * @deprecated Use \CoreLibs\Debug\Support::getCallerClass() insteader
+ */
+ private function getCallerClass(): string
+ {
+ // get the last class entry and wrie that
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) ?? [['class' => get_class($this)]];
+ return end($backtrace)['class'];
+ }
+
// *** PUBLIC ***
/**
@@ -384,7 +397,7 @@ class Logging
if (!in_array($type, ['level', 'class', 'page', 'run'])) {
return;
}
- $this->{'log_per'.$type} = $set;
+ $this->{'log_per_'.$type} = $set;
}
/**
@@ -397,7 +410,7 @@ class Logging
if (!in_array($type, ['level', 'class', 'page', 'run'])) {
return false;
}
- return $this->{'log_per'.$type};
+ return $this->{'log_per_'.$type};
}
/**
@@ -418,8 +431,7 @@ class Logging
$this->error_msg[$level] = '';
}
// get the last class entry and wrie that
- $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) ?? [['class' => get_class($this)]];
- $class = end($backtrace)['class'];
+ $class = \CoreLibs\Debug\Support::getCallerClass();
// get timestamp
$timestamp = \CoreLibs\Debug\Support::printTime();
// HTML string, create only if we have echo
@@ -502,7 +514,7 @@ class Logging
// create the output wrapper around, so we have a nice formated output per class
if ($string_output) {
$string_prefix = '