Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#3136) Incorporate the domain id in the log file nomenclatur… #24893

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CRM/Core/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ protected static function generateLogFileName($prefix) {
else {
$hash = '';
}
$fileName = $config->configAndLogDir . 'CiviCRM.' . $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
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Core/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testDebugLoggerFormat() {
$log->log('Little lamb');
$config = CRM_Core_Config::singleton();
$fileContents = file_get_contents($log->_filename);
$this->assertEquals($config->configAndLogDir . 'CiviCRM.' . '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);
Expand Down