# Vhost error\_log ignored with passenger

**URL:** <https://www.ruby-forum.com/t/vhost-error-log-ignored-with-passenger/217487>\
**Category:** NGINX\
**Created:** [March 2, 2012, 9:18pm UTC](https://www.ruby-forum.com/t/vhost-error-log-ignored-with-passenger/217487 "2012-03-02T21:18:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 2, 2012, 9:18pm UTC](https://www.ruby-forum.com/t/vhost-error-log-ignored-with-passenger/217487/1 "2012-03-02T21:18:16Z")

</div>

I’m using passenger and seeing that stdout & stderr are going to nginx’s  
default error log, rather than what’s specified in the server {  
error\_log … } directive. Is this a known bug in nginx or passenger?

```
server {
    listen 8082;
    access_log logs/ruby-access.log main;
    error_log logs/ruby-error.log; ## nothing in here from ruby's

```

$std{out,err}!  
root /Users/paulm/Code/nginx/public;  
location / {  
passenger\_enabled on;  
}  
}

Here’s all the code & config; it’s a trivial Sinatra server:

> <https://gist.github.com/1960979>

Phusion Passenger from here: [Install — Phusion Passenger™ (a.k.a. mod\_rails / mod\_rack)](http://www.modrails.com/install.html) (seems  
to install nginx 1.0.10)

(The workaround is to File#reopen in [config.ru](http://config.ru) but I’d like to avoid  
this, if possible.)

Many thanks!

Paul

Posted at Nginx Forum:

> **[vhost error\_log ignored with passenger](https://forum.nginx.org/read.php?2,223288,223288#msg-223288)**
>
> I'm using passenger and seeing that stdout & stderr are going to nginx's default error log, rather than what's specified in the server { error\_log ... } directive. Is this a known bug in nginx or passenger? server { listen 8082; access\_log l

---

<div class="post-metadata">

**Author:** ![tantrix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@tantrix](https://www.ruby-forum.com/u/tantrix)\
**Post date:** [March 11, 2012, 4:21pm UTC](https://www.ruby-forum.com/t/vhost-error-log-ignored-with-passenger/217487/2 "2012-03-11T16:21:05Z")

</div>

I can confirm this.

nginx version: nginx/1.0.12  
Phusion Passenger version 3.0.11

In my case, I have error\_log defined at all three levels, as described  
here:

[Separating Error Logs per Virtual Host | NGINX](http://wiki.nginx.org/SeparateErrorLoggingPerVirtualHost)

Posted at Nginx Forum:

> **[Re: vhost error\_log ignored with passenger](https://forum.nginx.org/read.php?2,223288,223729#msg-223729)**
>
> I'm using passenger and seeing that stdout & stderr are going to nginx's default error log, rather than what's specified in the server { error\_log ... } directive. Is this a known bug in nginx or passenger? server { listen 8082; access\_log l

---

<div class="post-metadata">

**Author:** ![tantrix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@tantrix](https://www.ruby-forum.com/u/tantrix)\
**Post date:** [March 11, 2012, 5:33pm UTC](https://www.ruby-forum.com/t/vhost-error-log-ignored-with-passenger/217487/3 "2012-03-11T17:33:59Z")

</div>

When reopening $stderr in “a” (append) mode, the file is not written to.  
However, when reopening with “w” (write) mode, things work as expected.

Also, since I have the server error log set to debug, reopening $stderr  
also results in other messages being written. For example, info  
messages.

Posted at Nginx Forum:

> **[Re: vhost error\_log ignored with passenger](https://forum.nginx.org/read.php?2,223288,223731#msg-223731)**
>
> I'm using passenger and seeing that stdout & stderr are going to nginx's default error log, rather than what's specified in the server { error\_log ... } directive. Is this a known bug in nginx or passenger? server { listen 8082; access\_log l
