fixes #2336 more details in Logger (execution_uuid)

This commit is contained in:
plegall
2025-03-01 14:20:11 +01:00
parent daef1ed375
commit 789c062837
3 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -2228,7 +2228,9 @@ function pwg_URL()
*/ */
function invalidate_user_cache($full = true) function invalidate_user_cache($full = true)
{ {
global $persistent_cache; global $persistent_cache, $logger;
$logger->info(__FUNCTION__.' starts');
if ($full) if ($full)
{ {
@@ -2249,6 +2251,7 @@ UPDATE '.USER_CACHE_TABLE.'
$persistent_cache->purge(true); $persistent_cache->purge(true);
conf_delete_param('count_orphans'); conf_delete_param('count_orphans');
trigger_notify('invalidate_user_cache', $full); trigger_notify('invalidate_user_cache', $full);
$logger->info(__FUNCTION__.' ends');
} }
/** /**
+3 -1
View File
@@ -340,11 +340,13 @@ class Logger
*/ */
private function formatMessage($level, $message, $cat, $context) private function formatMessage($level, $message, $cat, $context)
{ {
global $page;
if (!empty($context)) if (!empty($context))
{ {
$message.= "\n" . $this->indent($this->contextToString($context)); $message.= "\n" . $this->indent($this->contextToString($context));
} }
$line = "[" . $this->getTimestamp() . "]\t[" . self::levelToCode($level) . "]\t"; $line = "[" . $this->getTimestamp() . '][exec='.($page['execution_uuid']??'unkonwn')."]\t[" . self::levelToCode($level) . "]\t";
if ($cat != null) if ($cat != null)
{ {
$line.= "[" . $cat . "]\t"; $line.= "[" . $cat . "]\t";
+2
View File
@@ -109,6 +109,8 @@ include(PHPWG_ROOT_PATH . 'include/template.class.php');
include(PHPWG_ROOT_PATH . 'include/cache.class.php'); include(PHPWG_ROOT_PATH . 'include/cache.class.php');
include(PHPWG_ROOT_PATH . 'include/Logger.class.php'); include(PHPWG_ROOT_PATH . 'include/Logger.class.php');
$page['execution_uuid'] = generate_key(10);
$persistent_cache = new PersistentFileCache(); $persistent_cache = new PersistentFileCache();
// Database connection // Database connection