Skip to content

Commit d82987d

Browse files
committed
update docs
1 parent 0d97e22 commit d82987d

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

+20-3
Original file line numberDiff line numberDiff 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+
3754
Run test with:
3855

3956
```bash

0 commit comments

Comments
 (0)