nginx's log does'nt work

It was supposed that errorlog is output to /var/log/nginx/error.log

But In fact it was not output.

my test code is below.


    public function get()
        return $this->getDI()->get("not_exist_di_module")->hoge;


user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log error;
pid /run/;



  function (Exception $exception) use ($app) {
    $logger = new Logger\Adapter\Syslog(null);

It's not work↑.

  function (Exception $exception) use ($app) {
        $logger = new Stream("php://stderr");
        $logger->error("This is another error");

It's not work↑.

  function (Exception $exception) use ($app) {
        $app->response->setStatusCode(500, "error of 500.")->send();

It's not work↑.

  function (Exception $exception) use ($app) {
        throw $exception;

It's not work↑.

//   $app->error(
//   function (Exception $exception) use ($app) {
//         throw $exception;
//   });

It's not work↑.

My environment is below.

Phalcon DevTools (3.4.0)

  OS: Linux fc4f20c672e4 4.9.60-linuxkit-aufs #1 SMP Mon Nov 6 16:00:12 UTC 2017 x86_64
  PHP Version: 7.2.8
  PHP SAPI: cli
  PHP Bin: /usr/bin/php
  PHP Extension Dir: /usr/lib64/php/modules
  PHP Bin Dir: /usr/bin
  Loaded PHP config: /etc/php.ini
  Phalcon DevTools Version: 3.4.0
  Phalcon Version: 3.4.1
  AdminLTE Version: 2.3.6

Please help me.

edited Sep '18

You have to distinguish between user level errors and server errors.

By default this is what you might see at nginx side:

2018/09/24 22:45:19 [error] 8243#0: *9612874 upstream prematurely closed connection while reading response header from upstream, client:, server:, request: "GET /huis_en_outdoors/huishouding/wasdrogers.html HTTP/1.1", upstream: "", host: ""

More details about nginx logging: