spatie / activitylog

A very simple activity logger to monitor the users of your website or application
https://spatie.be/opensource/laravel
MIT License
582 stars 75 forks source link

Logging activity to a different database connection question #54

Closed denitsa-md closed 6 years ago

denitsa-md commented 6 years ago

We have a multi-tenancy setup with multiple databases for each tenant and a main shared one. I would like to be able to do simple logging on a tenant database connection (not the main).

I read your comment here: https://github.com/spatie/activitylog/issues/42 but that will only work for model event logging.

I would like to do a simple activity()->log('Look mum, I logged something'); that would go to a tenant database. Is there any clean way of setting the connection?

denitsa-md commented 6 years ago

Ah..actually nevermind.

First, it was the wrong repository that I posted in.

Then I figured I could extend your activity class and just set the $connection property on it.

Sorry about opening the issue.