Skip to content

Commit 779b0a1

Browse files
authored
Merge pull request #1345 from tobischulz/patch-1
Update using-multiple-logs.md
2 parents 82fc7bd + b75d470 commit 779b0a1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/advanced-usage/using-multiple-logs.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ Activity::all()->last()->log_name; //returns 'other-log';
2929

3030
## Specifying a log for each model
3131

32-
By default, the `LogsActivity` trait uses `default_log_name` from the config file to write the logs. You can set a different log for each model by setting the `$logName` property on the model.
32+
By default, the `LogsActivity` trait uses `default_log_name` from the config file to write the logs. To customize the log's name for each model, call the useLogName() method when configuring the LogOptions.
3333

3434
```
35-
protected static $logName = 'custom_log_name_for_this_model';
35+
public function getActivitylogOptions(): LogOptions
36+
{
37+
return LogOptions::defaults()
38+
->useLogName('custom_log_name_for_this_model');
39+
}
3640
```
3741

3842
## Retrieving activity

0 commit comments

Comments
 (0)