PHPackages                             loremipsum/action-logger-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. loremipsum/action-logger-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

loremipsum/action-logger-bundle
===============================

Symfony bundle to log custom actions and events with doctrine.

v0.4.2(6mo ago)1108MITPHPPHP &gt;=8.1CI failing

Since Oct 2Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/loremipsum/action-logger-bundle)[ Packagist](https://packagist.org/packages/loremipsum/action-logger-bundle)[ Docs](https://www.loremipsum.at)[ RSS](/packages/loremipsum-action-logger-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (15)Used By (0)

ActionLogger bundle
===================

[](#actionlogger-bundle)

Symfony bundle to log custom actions and events with doctrine.

Configuration
-------------

[](#configuration)

```
# config/packages/lorem_ipsum_action_logger.yaml

lorem_ipsum_action_logger:
    # mapping is used to store actions in the database without using the class name
    mapping:
        user.add: { class: App\Action\User\UserAddAction }
        user.edit: { class: App\Action\User\UserEditAction, alias: 'user_edit' }
        settings.edit: { class: App\Action\SettingsEditAction, alias: ['settings_edit', 'settings_update'] }
    # entity_mapping is used to store action relations to entities in the database using the class name
    entity_mapping:
        user: App\Entity\User
        settings: App\Entity\Settings
```

Action example
--------------

[](#action-example)

Usage example: A new user has been created. All you have to do is call `log` or `flashLog`on our ActionLogger with the `UserAddAction` and the new `$user` entity.

```
/** @var LoremIpsum\ActionLoggerBundle\ActionLogger $actionLogger **/
$actionLogger->log(new UserAddAction($user));
// Display action message as flash message
$actionLogger->flashLog(new UserAddAction($user), 'success');
```

And here is our `UserAddAction`:

```
