# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
    secret: '%env(APP_SECRET)%'

    # Note that the session will be started ONLY if you read or write from it.
    session: true

    # Translator configuration
    default_locale: fr
    translator:
        default_path: '%kernel.project_dir%/translations'
        fallbacks:
            - fr
            - en

    #esi: true
    #fragments: true

    # Derrière nginx / reverse proxy (OVH) : lire X-Forwarded-For pour le bypass maintenance.
    trusted_proxies: '127.0.0.1,REMOTE_ADDR'
    trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port']

when@test:
    framework:
        test: true
        session:
            storage_factory_id: session.storage.factory.mock_file

when@prod:
    framework:
        # 404/405 = bruit (bots, favicon, routes inexistantes) : ne pas polluer prod.log.
        # Les vraies erreurs (5xx, exceptions applicatives) restent en error/critical.
        exceptions:
            Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
                log_level: debug
            Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException:
                log_level: debug
