0

I want to use loogable extension, but it doesn't write anything in ext_log_enties table.

I'm using symfony 5.4 and Api-platform 2.6.8 in my project.

My configuration:

doctrine.yaml

doctrine:
    dbal:
      ...
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            gedmo_loggable:
                type: annotation
                prefix: Gedmo\Loggable\Entity
                dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Loggable/Entity"
                alias: GedmoLoggable # (optional) it will default to the name set for the mapping
                is_bundle: false
            ...

stof_doctrine_extensions.yaml

stof_doctrine_extensions:
    default_locale: fr_FR
    orm:
        default:
           ...
            loggable: true

User.php

#[Gedmo\Loggable]
class User implements UserInterface
{
     /**
     * @ORM\Column(type="string", length=128, nullable=false)
     */
    #[Gedmo\Versioned]
    private ?string $firstName = null;

    /**
     * @ORM\Column(type="string", length=128, nullable=false)
     */
    #[Gedmo\Versioned]
    private ?string $lastName = null;
}

service.yaml :

services:
   ...
  gedmo.listener.loggable:
    class: Gedmo\Loggable\LoggableListener
    tags:
      - { name: doctrine.event_subscriber, connection: default }

What's wrong in my configuration ?

Dylan KAS
  • 4,840
  • 2
  • 15
  • 33
  • I don't see anything weird, can you try removing what you added in doctrine.yaml and service.yaml ? Try clearing the cache and look if there is still no logs. Also is the extension enabled in `config/bundles.php` ? – Dylan KAS Sep 27 '22 at 13:55

0 Answers0