Log to stdout but not to /var/log/nginx/error.log

173 views
Skip to first unread message

Theja Vempalli

unread,
Feb 26, 2016, 11:32:29 PM2/26/16
to Phusion Passenger Discussions
Hi All,

Phusion Passenger makes all the content on stdout to be written to 
  1. /var/log/nginx/error.log 
  2. /var/log/syslog
My project is running inside docker container. The host that runs my docker container is configured in such a way that whatever written to stdout gets shown in sumologic. So if something goes wrong I can just see logs in sumologic rather than requesting operation team for logfiles.

But Phusion Passenger writes all the content to above 2 locations. Is it possible to have the logs written back to stdout instead of /var/log/nginx/error.log? My application is a Ruby (Sinatra) app.

Thanks,
Theja

Cynthia Kiser

unread,
Mar 7, 2016, 11:36:41 PM3/7/16
to phusion-...@googlegroups.com
Doesn't look like anyone answered you. I don't know the answer - but I was wondering if using Phusion's docker base images would solve your problem: 


--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phusion-passen...@googlegroups.com.
To post to this group, send email to phusion-...@googlegroups.com.
Visit this group at https://groups.google.com/group/phusion-passenger.
To view this discussion on the web visit https://groups.google.com/d/msgid/phusion-passenger/1b669de0-f1dc-4f5c-9be7-06bcec282a3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cynthia Kiser
cynthi...@gmail.com

Theja Vempalli

unread,
Mar 7, 2016, 11:58:31 PM3/7/16
to Phusion Passenger Discussions
Hi Cynthia,

Thanks for your response. I am using passenger-docker base images. By default these base images end up writing the log content to error.log and syslog. In my case I want them to be written to stdout but not to error.log and syslog. So I ended up symlinking error.log to stdout. Something like below:

ln -sf /dev/stdout /var/log/nginx/error.log


So symlinking it to stdout solved my problem. Also another approach to solve my issue is to run tail -f /var/log/nginx/error.log in background (this approach was suggested by one of the passenger phusion's authors)

Thanks
Reply all
Reply to author
Forward
0 new messages