Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cakephp/log
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.x
Choose a base ref
...
head repository: cakephp/log
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.next
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 7, 2026

  1. Stop a logger from reentering itself while it is dispatching (#19589)

    A logger that writes through a subsystem which logs its own failures can be asked
    to write again while it is still handling a message. Nothing noticed, so the two
    called each other until the process ran out of memory.
    
    The reachable route needs no exotic setup. A logger that stores rows in a table
    performs an insert, Cake\Database\Log\QueryLogger picks that insert up and calls
    Log::write('debug', ...), and the message comes straight back to the same logger,
    which inserts another row. Scopes do not help: BaseLog defaults to an empty
    scopes array, and Log::write() treats an empty array as matching everything,
    scoped messages included. So a logger configured with nothing but a className is
    exposed.
    
    A second route runs through the cache. An engine that cannot reach its backend
    logs the failure, and a table-backed logger asking for schema metadata lands back
    in the cache pool that is still being built.
    
    Track which streams are dispatching and skip a stream that is already inside a
    write. The nested message goes to error_log() rather than being dropped
    silently, and the other configured loggers still receive it, so one logger
    looping does not silence the rest of the stack. The marker is cleared in a
    finally, so a logger that throws does not disable itself for the remainder of the
    process.
    
    Keyed per stream rather than a single global flag on purpose. A global flag would
    suppress every logger for the duration of any nested write, which is a much
    broader change than the problem calls for. The tradeoff is that a cycle running
    across two different streams is not caught; that needs a depth counter and is not
    worth the complexity until someone hits it.
    dereuromark authored Aug 7, 2026
    Configuration menu
    Copy the full SHA
    364533a View commit details
    Browse the repository at this point in the history
Loading