File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,32 @@ use Cesargb\Log\Rotation;
2525$rotation = new Rotation();
2626
2727$rotation
28- ->compress() // Optional, compress the file after rotated
29- ->files(30) // Optional, files are rotated 30 times before being removed
30- ->minSize(1024) // Optional, are rotated when they grow bigger than 1024 bytes
28+ ->compress() // Optional, compress the file after rotated. Default false
29+ ->files(30) // Optional, files are rotated 30 times before being removed. Default 366
30+ ->minSize(1024) // Optional, are rotated when they grow bigger than 1024 bytes. Default 0
3131 ->then(function ($filename) {}) // Optional, to get filename rotated
3232 ->catch(function ($exception) {}) // Optional, to catch a exception in rotating
3333 ->rotate('file.log');
3434```
3535
36+ Or you can define the options in the constructor
37+
38+ ``` php
39+ use Cesargb\Log\Rotation;
40+
41+ $rotation = new Rotation([
42+ 'files' => 1,
43+ 'compress' => true,
44+ 'min-size' => 10,
45+ 'then' => function ($filename) {},
46+ 'catch' => function ($error) {},
47+ ]);
48+
49+ $rotation->rotate('file.log');
50+ ```
51+
3652## Test
53+
3754Run test with:
3855
3956``` bash
You can’t perform that action at this time.
0 commit comments