File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,21 @@ only for a specific handler.
236
236
generate hundreds of log lines. Consider using tools like the `logrotate `_
237
237
Linux command to rotate log files before they become a problem.
238
238
239
+ In case you cannot use a dedicated tool for rotating log files, consider using
240
+ the special ``rotating_file `` handler defined by Monolog. This handler creates
241
+ a new log file every day and can also remove old files automatically. To use
242
+ it, just set the ``type `` option of your handler to ``rotating_file ``:
243
+
244
+ .. code-block :: yaml
245
+
246
+ # app/config/config_dev.yml
247
+ monolog :
248
+ handlers :
249
+ main :
250
+ type : rotating_file # <-- this value is usually 'stream'
251
+ path : %kernel.logs_dir%/%kernel.environment%.log
252
+ level : debug
253
+
239
254
A processor is simply a callable receiving the record as its first argument.
240
255
Processors are configured using the ``monolog.processor `` DIC tag. See the
241
256
:ref: `reference about it <dic_tags-monolog-processor >`.
You can’t perform that action at this time.
0 commit comments