maxFiles for logs not working with private:// custom scheme

Created on 12 December 2022, over 2 years ago
Updated 3 January 2025, 4 months ago

Hello,

I integrated monolog as described in the readme. One piece of my config is as follows:

services:
  monolog.handler.rotating_file:
    class: Monolog\Handler\RotatingFileHandler
    arguments: ['private://logs/debug.log', 10, 'debug']

As you can see, the private "protocol" (custom scheme) is used. I defined the private folder in my settings.php:

$settings['file_private_path'] = '/var/www/html/app/private';

Now the maxFiles config isn't applied. I debugged the line where the problem is created:

Monolog\Handler\RotatingFileHandler:

protected function rotate(): void {
  // ...
  $logFiles = glob($this->getGlobPattern()); // here the issue happens: glob() brings an empty array
}

If I skip using the private:// protocol and use an absolute path instead, it works as expected.

It doesn't work both in my local DDEV and on the server.

Does anybody have an idea what might be causing the issue?

Thanks in advance

Bye Defcon0

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024