Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate out logs for each server block on the nginx router #18

Open
madhurranjan opened this issue Apr 10, 2017 · 1 comment
Open

Separate out logs for each server block on the nginx router #18

madhurranjan opened this issue Apr 10, 2017 · 1 comment

Comments

@madhurranjan
Copy link

madhurranjan commented Apr 10, 2017

We need to be able to have separate log files for access and error per server block in nginx. This is so that we can debug applications separately instead of looking at a generic log file . This is needed as we get more traffic and applications on Nginx.

Configuration that you might need in the template for each server:
server {
server_name
error_log /var/log/error_<deployment_name>.log error;
access_log /var/log/access
<deployment_name>_.log router;
}
router and error here at the end of each lines represent the log format in nginx. I'll add another issue for the log format.

@mpnally
Copy link

mpnally commented Apr 11, 2017

Mamu, what is <deployment_name>? What do you think about:

error_log /var/log/nginx/error_<server_name>.log level;
access_log /var/log/nginx/access_<server_name>.log format;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants