Pending

User tests: Successful: Unsuccessful:

avatar muhme
muhme
8 Nov 2025

Summary of Changes

In setting up the log format:

  • Use \t instead of raw tab characters so they remain clearly visible when reading the code, regardless of the editor or configuration.
  • Remove the incorrect use of $options['format'].
  • Avoid setting the log format if it is identical to the default.

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?

Testing Instructions

  1. Do code review
  2. Test the logging for all modified places

The different changes could be tested (ensure 'Log Almost Everything' is enabled):

  • administrator/components/com_finder/src/Controller/IndexerController.php
    • (the three replaces are only tested for one place)
    • Components > Smart Search > Index > Start the Indexer / Index
    • Check if the log messages are stored in administrator/logs/indexer.php with the default format
  • administrator/components/com_finder/src/Response/Response.php
    • Components > Smart Search > Index > Options > Index > Enable Logging > Yes
    • Components > Smart Search > Index > Start the Indexer / Index
    • Check if the log messages are stored in administrator/logs/indexer.php with the default format
  • administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
    • Upload and Update this PR's update package
    • Check if the log messages are stored in administrator/logs/joomla_update.php with the default format
  • administrator/components/com_scheduler/src/Scheduler/Scheduler.php
    • Append one line in file administrator/components/com_scheduler/src/Scheduler/Scheduler.php after line 128 Log::addLogger()
      Log::add("SCHEDULER LOGGING TEST", Log::ERROR);
      
    • System > Scheduled Tasks > New > GET Request > Set Title, Interval in Minutes > 1, any request URL > Advanced > Individual Task Logs > Enabled
    • 'Run Test' for new created scheduled task
    • Check test log message is stored in administraor/log/joomla_scheduler.php in the given non-default format
  • administrator/components/com_scheduler/src/Task/Task.php
    • System > Scheduled Tasks > Session GC > Advanced > Individual Task Logs > Enabled
    • 'Run Test' for Session GC entry
    • Check if the log messages are stored in administrator/logs/task_*.log.php in the given non-default format
  • installation/includes/app.php
    • Remove configuration.php
    • Insert the following line near the end of installation/includes/app.php file, before $app->execute();
      \Joomla\CMS\Log\Log::add('INSTALLATION LOG TEST', \Joomla\CMS\Log\Log::ERROR, 'error');
      
    • Run Joomla Web Installer
    • Check if the test log message is stored in administrator/logs/error.log in given default format
  • installation/includes/cli.php
    • Insert the following line near the end of installation/includes/cli.php file, before $app->execute();
      \Joomla\CMS\Log\Log::add('CLIENT LOG TEST', \Joomla\CMS\Log\Log::ERROR, 'error');
      
    • Run php installation/joomla.php install
    • Check if the test log message is stored in administrator/logs/error.log in given default format
  • libraries/src/Log/Logger/FormattedtextLogger.php
    • Force an log message, e.g. disable email and create user
      • Home Dashboard > Global Configuration > Server > Mail > Send Mail > No
      • Users > Manage > New
      • Check if the WARNING log messages is stored in administrator/logs/everything.php in default formatvi
  • libraries/src/Log/Logger/W3cLogger.php
    • Insert the following lines near the end of 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);
      
    • Call the frontend site
    • Check if the log messages are stored in administrator/logs/w3c-test.php in the default format
  • plugins/system/webauthn/src/Extension/Webauthn.php
    • Accessing the site over HTTPS > User Menu > Edit Account > Passkey Login > Add New Passkey
    • Logout, Login using 'Sign in with a passkey'
    • Check if the log messages are stored in administrator/logs/webauthn_system.php in the given non-default format
  • Final check there are no places left
    • With unused options.format and
    • No raw tab characters in log format strings
    • find . -name \*.php | xargs grep "{MESSAGE}"

Actual result BEFORE applying this Pull Request

  • Unused $options['format'] exist in code, default log format is set again and raw tab characters are used in log format strings.

Expected result AFTER applying this Pull Request

  • No more usage of $options['format'] exist in code, default log format is not set again and \t is used in log format strings.
  • Logging is not changed in any way.

Link to documentations

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

avatar muhme muhme - open - 8 Nov 2025
avatar muhme muhme - change - 8 Nov 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Nov 2025
Category Administration com_finder com_joomlaupdate Installation Libraries Front End Plugins
avatar brianteeman
brianteeman - comment - 8 Nov 2025

pretty sure that this cant go into a patch release

avatar richard67
richard67 - comment - 9 Nov 2025

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.

avatar alikon alikon - test_item - 16 Nov 2025 - Tested successfully
avatar alikon
alikon - comment - 16 Nov 2025

I have tested this item ✅ successfully on 0c36f8a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46422.

Add a Comment

Login with GitHub to post a comment