Redirect Pimcore logs to php://stderr or php://stdout

Tom Hatzer • January 15, 2021

pimcore snippets

You can redirect the log output of Pimcore if you are working with docker or likewise to php://stderr or php://stdout by appending the following snippet to your app/config/config.yml file:

monolog:
  handlers:
    main:
      type: stream
      path: "php://stderr"
      level: warning
    stdout:
      type: stream
      path: "php://stdout"
      level: warning
    stderr:
      type: stream
      path: "php://stderr"
      level: warning

You can customize the log level if you wish. This just prints warnings errors and exceptions to the monolog stream.