Where can I find the error logs of nginx, using FastCGI and Django?
Solution 1
Errors are stored in the nginx log file. You can specify it in the root of the nginx configuration file:
error_log /var/log/nginx/nginx_error.log warn;
On Mac OS X with Homebrew, the log file was found by default at the following location:
/usr/local/var/log/nginx
Solution 2
I was looking for a different solution.
Error logs, by default, before any configuration is set, on my system (x86 Arch Linux), was found in:
/var/log/nginx/error.log
Solution 3
Run this command, to check error logs:
tail -f /var/log/nginx/error.log
Solution 4
My ngninx logs are located here:
/usr/local/var/log/nginx/*
You can also check your nginx.conf
to see if you have any directives dumping to custom log.
run nginx -t
to locate your nginx.conf
.
# in ngingx.conf
error_log /usr/local/var/log/nginx/error.log;
error_log /usr/local/var/log/nginx/error.log notice;
error_log /usr/local/var/log/nginx/error.log info;
Nginx is usually set up in /usr/local
or /etc/
. The server could be configured to dump logs to /var/log
as well.
If you have an alternate location for your nginx install and all else fails, you could use the find
command to locate your file of choice.
find /usr/ -path "*/nginx/*" -type f -name '*.log'
, where /usr/
is the folder you wish to start searching from.
Solution 5
Logs location on Linux servers:
Apache – /var/log/httpd/
IIS – C:\inetpub\wwwroot\
Node.js – /var/log/nodejs/
nginx – /var/log/nginx/
Passenger – /var/app/support/logs/
Puma – /var/log/puma/
Python – /opt/python/log/
Tomcat – /var/log/tomcat8
Comments
-
ha22109 almost 2 years
I'm using Django with FastCGI + nginx. Where are the logs (errors) stored in this case?
-
Michael Berkowski over 9 yearsApparently this is configureable only at compile time with the
--error-log-path
compile option trac.nginx.org/nginx/ticket/147 -
jmarceli about 9 yearsThat's maybe version dependent but my log is inside:
/opt/nginx/logs/error.log
-
Félix Adriyel Gagnon-Grenier over 8 yearson Mac OS X with homebrew: /usr/local/var/log/nginx. see lfender's answer
-
MarthyM over 7 yearsOn ubuntu I have it in
/var/log/nginx/error.log
. It is best to check thenginx.conf
file and find theerror_log
setting. -
mrun over 6 yearsThat is not an answer and should be a comment instead. Once you have sufficient reputation you will be able to comment.
-
Jan Bludau about 6 yearson raspberry pi3 its the location
-
Sridhar Sarnobat almost 5 yearsThe logs will be here if you installed Nginx with Homebrew.
-
Amit Verma almost 4 yearsPls do consider of explaining your code and how it would help, so that others can be benefited from this.