Skip to content

Add file rotation by hour#2001

Open
baks-dev wants to merge 2 commits intoSeldaek:mainfrom
baks-dev:patch-1
Open

Add file rotation by hour#2001
baks-dev wants to merge 2 commits intoSeldaek:mainfrom
baks-dev:patch-1

Conversation

@baks-dev
Copy link
Copy Markdown

@baks-dev baks-dev commented Oct 26, 2025

Hello,

I suggest rotating log files hourly. Large logs are often difficult to load into the IDE, view and analyze. At the user's discretion, it would be useful to separate by specifying a format like 'Y-m-d-H' in the settings. I will give an example of a php configuration:

    $config
        ->handler('request')
        ->formatter('monolog.formatter.standard')
        ->type('rotating_file')
        ->maxFiles(168)
        ->dateFormat('Y-m-d-H')
        ->filenameFormat('{filename}-{date}')
        ->path('%kernel.logs_dir%/request-%kernel.environment%.log')
        ->level('debug')
        ->channels()
        ->elements(['request']);

Rotating log files hourly. Large logs are often difficult to load into the IDE, view and analyze. At the user's discretion, it would be useful to separate by specifying a format like 'Y-m-d-H' in the settings.
['Y', 'y', 'm', 'd'],
['[0-9][0-9][0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]'],
['Y', 'y', 'm', 'd', 'H'],
['[0-9][0-9][0-9][0-9][0-9]', '[0-9][0-9][0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]', '[0-9][0-9]'],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks borked.. It should just add , '[0-9][0-9]' at the end of the line I think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really stupid mistake ))

@Seldaek Seldaek added this to the 3.x milestone Nov 4, 2025
@Seldaek Seldaek removed the Needs Work label Nov 5, 2025
@Seldaek
Copy link
Copy Markdown
Owner

Seldaek commented Nov 5, 2025

Tests are failing can you please check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants