Ecs, metricbeat, docker, apache, stdout where am I going wrong?

my application is php, we use monolog for logs and I have it configured to log to STDOUT as well as a file

monolog:
    channels: [main]
    handlers:
        main:
            type:   rotating_file
            path:   "%kernel.logs_dir%/%kernel.environment%.log"
            level:  "%monolog_verbosity%"
            channels: [main, request, php]
            max_files: 30
        stdout:
          type:   stream
          path:   "php://stdout"
          level:  "%monolog_verbosity%"
          channels: [main, request, php]

apache configured to log to STDOUT as well

DocumentRoot /var/www/my-app

    SSLEngine on

    SSLCertificateFile  /path/my-app.crt
    SSLCertificateKeyFile /path/my-app.key

    ServerSignature Off
    SetEnvIf Remote_Addr "::1" dontlog
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined_with_x_forward_for

    CustomLog /proc/self/fd/1 combined_with_x_forward_for env=!dontlog
    ErrorLog /proc/self/fd/2

https://docs.docker.com/config/containers/logging/ point to here https://github.com/docker-library/httpd/blob/b13054c7de5c74bbaa6d595dbe38969e6d4f860c/2.2/Dockerfile#L72-L75 for Apache STDOUT

1 Like