From 15f77dd63a9064acb74727bdaf4b3b7a4938e427 Mon Sep 17 00:00:00 2001 From: Sandor Semsey Date: Mon, 5 Jun 2023 14:37:04 +0200 Subject: [PATCH] use dot to delimit log filename --- CRM/Core/Error.php | 2 +- tests/phpunit/CRM/Core/ErrorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 9a50144288..1ff5ab8458 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -689,7 +689,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { else { $hash = ''; } - $fileName = $config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '_' . $prefixString . $hash . 'log'; + $fileName = $config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '.' . $prefixString . $hash . 'log'; // Roll log file monthly or if greater than our threshold. // Size-based rotation introduced in response to filesize limits on diff --git a/tests/phpunit/CRM/Core/ErrorTest.php b/tests/phpunit/CRM/Core/ErrorTest.php index f38553dee3..87d7e86bb8 100644 --- a/tests/phpunit/CRM/Core/ErrorTest.php +++ b/tests/phpunit/CRM/Core/ErrorTest.php @@ -107,7 +107,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { $log->log('Little lamb'); $config = CRM_Core_Config::singleton(); $fileContents = file_get_contents($log->_filename); - $this->assertEquals($config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '_' . 'my-test.' . CRM_Core_Error::generateLogFileHash($config) . '.log', $log->_filename); + $this->assertEquals($config->configAndLogDir . 'CiviCRM.' . CIVICRM_DOMAIN_ID . '.' . 'my-test.' . CRM_Core_Error::generateLogFileHash($config) . '.log', $log->_filename); // The 5 here is a bit arbitrary - on my local the date part is 15 chars (Mar 29 05:29:16) - but we are just checking that // there are chars for the date at the start. $this->assertTrue(strpos($fileContents, '[info] Mary had a little lamb') > 10); -- 2.25.1