File tree 1 file changed +40
-9
lines changed
1 file changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -241,15 +241,46 @@ only for a specific handler.
241
241
a new log file every day and can also remove old files automatically. To use
242
242
it, just set the ``type `` option of your handler to ``rotating_file ``:
243
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
244
+ .. configuration-block ::
245
+
246
+ .. code-block :: yaml
247
+
248
+ # app/config/config_dev.yml
249
+ monolog :
250
+ handlers :
251
+ main :
252
+ type : rotating_file
253
+ path : %kernel.logs_dir%/%kernel.environment%.log
254
+ level : debug
255
+
256
+ .. code-block :: xml
257
+
258
+ <!-- app/config/config_dev.xml -->
259
+ <?xml version =" 1.0" charset =" UTF-8" ?>
260
+ <container xmlns =' ' http://symfony.com/schema/dic/services"
261
+ xmlns:monolog=" http://symfony.com/schema/dic/monolog" >
262
+
263
+ <monolog:config>
264
+ <monolog:handler name=" main"
265
+ type=" rotating_file"
266
+ path=" %kernel.logs_dir%/%kernel.environment%.log"
267
+ level=" debug"
268
+ />
269
+ </monolog:config>
270
+ </container>
271
+
272
+ .. code-block:: php
273
+
274
+ // app/config/config_dev.php
275
+ $container->loadFromExtension('monolog', array(
276
+ 'handlers' => array(
277
+ 'main' => array(
278
+ 'type' => 'rotating_file',
279
+ 'path' => '%kernel.logs_dir%/%kernel.environment%.log',
280
+ 'level' => 'debug',
281
+ ),
282
+ ),
283
+ ));
253
284
254
285
A processor is simply a callable receiving the record as its first argument.
255
286
Processors are configured using the ``monolog.processor`` DIC tag. See the
You can’t perform that action at this time.
0 commit comments