Laravel-activitylog: Modifying Methods of ActivityLogger.php without touching it's code

Created on 11 Mar 2017  路  1Comment  路  Source: spatie/laravel-activitylog

Is it possible to set up my own class that extends ActivityLogger and use it?

I want to add a few things (for example logging IP address in separate database column), but don't want to change the code of the package, so I can still update it.

Most helpful comment

Currently there's no way of customizing the ActivityLogger itself.

You have two options to add the IP address to a logged item.

  1. You can leverage custom properties.

  2. You could create an observer on the Activity model and let it add the IP address to the row whenever an Activity model is created.

>All comments

Currently there's no way of customizing the ActivityLogger itself.

You have two options to add the IP address to a logged item.

  1. You can leverage custom properties.

  2. You could create an observer on the Activity model and let it add the IP address to the row whenever an Activity model is created.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucianobosco picture lucianobosco  路  5Comments

uyab picture uyab  路  4Comments

rjcrystal picture rjcrystal  路  5Comments

marky291 picture marky291  路  4Comments

farshadff picture farshadff  路  4Comments