monolog icon indicating copy to clipboard operation
monolog copied to clipboard

Add file rotation by hour

Open baks-dev opened this issue 2 months ago • 1 comments

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']);

baks-dev avatar Oct 26 '25 20:10 baks-dev

Tests are failing can you please check?

Seldaek avatar Nov 05 '25 16:11 Seldaek