Laravel-activitylog: Activity Model Logging, Let us ignore console changes.

Created on 7 Jun 2018  路  4Comments  路  Source: spatie/laravel-activitylog

I use migration tables for both new tables and new data inserts based on its 'revision' based system.

I have read you can use the disable logging feature however this is cumbersome when it appears on 100 different files and will appear in future files, I am proposing a change where data cannot be logged if it is running in console (config), or having a configuration for a different 'log type' to weed this out when displaying back the activity log of all users.

Most helpful comment

Thanks for your suggestion. I think the vast majority of users doesn't need this option and I'd like to keep this package as simple as possible.

All 4 comments

But console are also other artisan commands that could add/change data. Like a user:create command.

So a general disable in console isn't cool.^^
I would recommend you to create a trait or abstract class with a setup/before and teardown/after method that handles the log dis/enable logic and you are fine.

I thought this was to show user activity?

Console isn't a user.

I'm inserting standard DB setup data with migrations/seeding, stuff that does not need to be logged (inserting settings into database etc).

I already made a copy of the trait and edited the CanLogFunction, personally I have it working fine now just suggesting the simple option.

I'm suggesting an option not a general disable.

Thanks for your suggestion. I think the vast majority of users doesn't need this option and I'd like to keep this package as simple as possible.

It depends on your app - even on console you can have an user. Imagine MySQL CLI or other tools like this.
And on the other hand this also creates some kind of change log for a model.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abdosaeedelhassan picture abdosaeedelhassan  路  4Comments

uyab picture uyab  路  4Comments

farshadff picture farshadff  路  4Comments

ekandreas picture ekandreas  路  3Comments

damosse31 picture damosse31  路  5Comments