K
K
kkoshakk2016-08-03 20:11:44
Nginx
kkoshakk, 2016-08-03 20:11:44

How to properly configure logs in nginx?

Logs need to be written in /etc/nginx/nginx.conf or /etc/nginx/sites-available or both, then how do they differ? What is the best way to enable error_log and access_log or one and what is the most optimal logging level?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Walt Disney, 2016-08-03
@ruFelix

sites-available logs for a specific host.
There are no answers to the rest of the questions, since you yourself determine what you need.
Turn everything off when you are upset that they are not there, then you will immediately understand everything.

P
Pavel Selivanov, 2016-08-03
@selivanov_pavel

error.log does not need to be turned off, you can only add log_not_found off; so that 404 access.log does not show there
, you can disable it, for example, for statics, if you are not interested in it. It's not worth turning it off completely IMHO, except for a specific case like an embedded device with 8 MB of brains

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question