After apache-nginx log is deleted and a file is re-created, the log cannot be displayed.
阿神
阿神 2017-05-16 17:00:43
0
2
506

There is a web.log file under the project root directory. The file was too big, so I deleted it and re-created an empty .log file. Now there is no log in this new file, and the pictures are of the old file. information

阿神
阿神

闭关修行中......

reply all (2)
phpcn_u1582

If you do not stop nginx when you delete the log, nginx still holds the handle of the old file. Although the newly created file has the same name, it is not actually the same file, so it is not written.
You need to reload nginx at this time

nginx -s reload

When clearing the log in the future, do not delete the file directly. Use the command to clear the file

truncate -s 0 web.log
    世界只因有你

    Whether the permissions of the newly created log file are configured correctly and whether write permissions are granted.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!