gedmo loggable doesn't save in database

1.6k views Asked by At

I want to register logs when i update my entity with gdmo-loggable, the table exists but no one register.

Here's my current code

# config.yaml
# Doctrine Configuration
doctrine:
      orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true

        filters:
            softdeleteable:
                class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                enabled: true
        mappings:
            gedmo_translatable:
                type: annotation
                prefix: Gedmo\Translatable\Entity
                dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
                is_bundle: false

            gedmo_loggable:
                type: annotation
                prefix: Gedmo\Loggable\Entity
                dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
                alias: GedmoLoggable # (optional) it will default to the name set for the mapping
                is_bundle: false

# StofDoctrineExtension Configuration
stof_doctrine_extensions:
    orm:
        default:
            timestampable: true
            softdeleteable: true
            blameable: true
            translatable: true
            loggable: true
    default_locale: fr_FR
    translation_fallback: true

#service.yaml
services:
 gedmo.listener.loggable:
        class: Gedmo\Loggable\LoggableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ "@annotation_reader" ] ]

#my entity.php
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * Entity.
 *
 * @ORM\Table(name="myEntity")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\myEntityRepository")
 * @Gedmo\SoftDeleteable(fieldName="deletedAt")
 * @Gedmo\Loggable
 *
 * @UniqueEntity("myEntityPrecedente")
 * @AssertMyEntity
 */
class MyEntity
{

/**
     * @var string
     *
     * @ORM\Column(name="observation", type="text", nullable=true)
     * Gedmo\versioned
     *
     * @Assert\Length(max="2000")
     */
    private $observation;

# symfony profiler/event list with priority numbers

kernel.request:
2048    
"Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure()"
256 
"Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest()"
128 
"Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest()"
48  
"Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest()"
32  
"Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest()"
24  
"Symfony\Bundle\FrameworkBundle\EventListener\ResolveControllerNameSubscriber::onKernelRequest()"
16  
"Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest()"
10  
"Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest()"
8   
"Symfony\Bundle\SecurityBundle\EventListener\FirewallListener::onKernelRequest()"
1   
"Sentry\SentryBundle\EventListener\RequestListener::onKernelRequest()"
1   
"Sentry\SentryBundle\EventListener\SubRequestListener::onKernelRequest()"
0   
"AppBundle\Services\EventListener\UtilisateurLocaleListener::onKernelRequest()"
0   
"Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber::onKernelRequest()"
0   
"Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest()"
0   
"Stof\DoctrineExtensionsBundle\EventListener\BlameListener::onKernelRequest()"
0   
"Stof\DoctrineExtensionsBundle\EventListener\LocaleListener::onKernelRequest()"
0   
"Stof\DoctrineExtensionsBundle\EventListener\LoggerListener::onKernelRequest()"

After following instructions from doc and searching on the web i have a problem with gedmo loggable from doctrine extension in my symfony project (3.3). There is no log data in table ext_log_entries when i update my entity. It's possible that my event priority catching nothing because it's priority is equal at 0 ? If someone have an idea, it would be helpful.

0

There are 0 answers