Answer the question
In order to leave comments, you need to log in
Why don't Monolog logs get into "Docker logs"?
Hello. I am setting up work with logs, I want to hook up a certain aggregator and collect all the logs with it. The aggregator receives logs that are visible in docker logs (that is, from stdout and stderr streams).
In my application, I'm trying to write a log to stdout and see it with the docker logs command:
$logger = new \Monolog\Logger('MyTestName');
$handler = new StreamHandler('php://stdout', Logger::DEBUG);
$logger->pushHandler($handler);
$logger->error('My test error message');
Answer the question
In order to leave comments, you need to log in
You run multiple applications inside the same container and naively assume that they all have the same first two file descriptors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question