Skip to content

How to change the log_name 'default'? #724

Answered by Gummibeer
kusman28 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

if you have an instance of the ActivityLogger you can use one of these two methods to define it on runtime.

public function useLog(string $logName)
{
$this->getActivity()->log_name = $logName;
return $this;
}
public function inLog(string $logName)
{
return $this->useLog($logName);
}

If you want to set the log name on model event logs you can use the tapActivity() method on each model to set the log_name attribute of the Activity model instance passed in.
The third option would be to use the Macroable trait of ActivityLogger class and add a method …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kuvar0158
Comment options

@kuvar0158
Comment options

Answer selected by Gummibeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #724 on May 28, 2020 10:18.