User tests: Successful: Unsuccessful:
In setting up the log format:
\t instead of raw tab characters so they remain clearly visible when reading the code, regardless of the editor or configuration.$options['format'].Perhaps surprisingly, despite the changes, this PR has no effect on the resulting logging in any way.
Background
In PR 46273, spaces in the log format were replaced with tab characters. During testing, it was observed that \t was used in some places, prompting a proposal to unify this convention — that is, to consistently use \t for tabulators in log format strings. See #46273 (comment).
During the development of this PR, it was discovered that the variable $options['format'] is not used. As a result, definitions such as '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}' are effectively ignored. This also explains why \t sequences in PHP single-quoted strings were never interpreted — the format was simply never applied.
👉 To define a custom logging format, use $options['text_entry_format'] instead.
There was an unused configuration of {LEVEL} in the indexer. I tested it with text_entry_format, but the logged result was only -. Therefore, it seems to be ineffective, and the currently used default format continues to be used.
Discussion
I would recommend to use only one default log format overall and simplify further in 6.1. For example instead "{DATE}\t{TIME}" use "{DATETIME}" everywhere. What are you thinking?
The different changes could be tested (ensure 'Log Almost Everything' is enabled):
administrator/components/com_finder/src/Controller/IndexerController.php
administrator/logs/indexer.php with the default formatadministrator/components/com_finder/src/Response/Response.php
administrator/logs/indexer.php with the default formatadministrator/components/com_joomlaupdate/src/Model/UpdateModel.php
administrator/logs/joomla_update.php with the default formatadministrator/components/com_scheduler/src/Scheduler/Scheduler.php
administrator/components/com_scheduler/src/Scheduler/Scheduler.php after line 128 Log::addLogger()
Log::add("SCHEDULER LOGGING TEST", Log::ERROR);
administraor/log/joomla_scheduler.php in the given non-default formatadministrator/components/com_scheduler/src/Task/Task.php
administrator/logs/task_*.log.php in the given non-default formatinstallation/includes/app.php
configuration.phpinstallation/includes/app.php file, before $app->execute();
\Joomla\CMS\Log\Log::add('INSTALLATION LOG TEST', \Joomla\CMS\Log\Log::ERROR, 'error');
administrator/logs/error.log in given default formatinstallation/includes/cli.php
installation/includes/cli.php file, before $app->execute();
\Joomla\CMS\Log\Log::add('CLIENT LOG TEST', \Joomla\CMS\Log\Log::ERROR, 'error');
php installation/joomla.php installadministrator/logs/error.log in given default formatlibraries/src/Log/Logger/FormattedtextLogger.php
administrator/logs/everything.php in default formatvilibraries/src/Log/Logger/W3cLogger.php
includes/app.php file, before $app->execute();
\Joomla\CMS\Log\Log::addLogger(
[
'logger' => 'w3c',
'text_file' => 'w3c-test.php',
]
);
\Joomla\CMS\Log\Log::add('W3C LOG TEST', \Joomla\CMS\Log\Log::ERROR);
administrator/logs/w3c-test.php in the default formatplugins/system/webauthn/src/Extension/Webauthn.php
administrator/logs/webauthn_system.php in the given non-default formatoptions.format andfind . -name \*.php | xargs grep "{MESSAGE}"$options['format'] exist in code, default log format is set again and raw tab characters are used in log format strings.$options['format'] exist in code, default log format is not set again and \t is used in log format strings.Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_finder com_joomlaupdate Installation Libraries Front End Plugins |
pretty sure that this cant go into a patch release
@brianteeman It can if it does not change the result so the logging will be the same as before.
I have tested this item ✅ successfully on 0c36f8a
pretty sure that this cant go into a patch release