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

BUG: \Neos\Flow\Log\Backend\BackendInterface->close() never gets called #3313

Open
1 task done
sjsone opened this issue Feb 10, 2024 · 0 comments
Open
1 task done
Labels

Comments

@sjsone
Copy link

sjsone commented Feb 10, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The close method of logging backends does not get called.

Expected Behavior

The close method should be called somewhere when flow is shutting down. As it is described in the doc-comment:

    /**
     * Carries out all actions necessary to cleanly close the logging backend, such as
     * closing the log file or disconnecting from a database.
     *
     * @return void
     * @api
     */
    public function close(): void;

The PsrLoggerFactory and Neos\Flow\Log\Psr\Logger should both lead to the backends being closed.

Steps To Reproduce

Either create your own logging backend (following the docs) or just add var_dump("closing"); die(); into the close() method of an existing (and used) backend.

Environment

- Flow: 8.3 (but probably since 5)
- PHP: 8.2

Anything else?

Talking to @mhsdesign he discovered that the close method had been called in the DefaultLogger. But that got removed when PSR-3 got fully implemented:

@sjsone sjsone added the Bug label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant