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

Per-application log files for Apache/Nginx integration mode #1279

Closed
FooBarWidget opened this issue Sep 13, 2014 · 80 comments
Closed

Per-application log files for Apache/Nginx integration mode #1279

FooBarWidget opened this issue Sep 13, 2014 · 80 comments

Comments

@FooBarWidget
Copy link
Member

Currently, all application stdout and stderr output is redirected to a single log file. Lately there seems to be more interest among users - in particular Node.js users - to have per-application log files.

We're considering adding this feature. If you'd like to see the feature too, please vote for it here. Note that we weight votes from Enterprise customers more heavily, so if you're an Enterprise customer please mention that here.

Edit: If working on this also see the (probably outdated) patch in #260.

@kiranos
Copy link

kiranos commented Sep 14, 2014

+1

3 similar comments
@ceecko
Copy link

ceecko commented Sep 14, 2014

+1

@rmldsky
Copy link

rmldsky commented Sep 17, 2014

👍

@filiphaftek
Copy link

+1

@weyert
Copy link

weyert commented Sep 18, 2014

+1 This would be a great addition!

@muluc
Copy link

muluc commented Sep 18, 2014

+1 :P

@piotr-sokolowski
Copy link

+1

@paulRbr
Copy link
Contributor

paulRbr commented Sep 26, 2014

That's a great idea, and we would love to see this feature bein added to Passenger. Thanks! 👍 +1

@sebgie
Copy link

sebgie commented Oct 3, 2014

+1

8 similar comments
@edy
Copy link

edy commented Oct 3, 2014

+1

@kszarek
Copy link

kszarek commented Oct 21, 2014

+1

@trevvvy
Copy link

trevvvy commented Oct 21, 2014

+1

@imerr
Copy link

imerr commented Oct 23, 2014

+1

@sobolk
Copy link

sobolk commented Nov 7, 2014

+1

@PhilWaldmann
Copy link

+1

@Ginja
Copy link

Ginja commented Nov 24, 2014

+1

@gerwinbrunner
Copy link

+1

@trevvvy
Copy link

trevvvy commented Dec 3, 2014

I think this has been addressed in the upcoming raptor release.

@FooBarWidget
Copy link
Member Author

It hasn't. It is not implemented yet.

@FooBarWidget
Copy link
Member Author

Unless you count the standalone mode. In the standalone mode you run a different Passenger instance per app, and so you have individual log files. But if you use the Nginx integration mode or the Apache integration mode, then that cannot separate log files per app yet.

@matthooks
Copy link

+1 to this, it's really weird to get all of my Rails stdout in the nginx error.log...

@BugRoger
Copy link

+1

1 similar comment
@devoll
Copy link

devoll commented Dec 22, 2014

+1

@forkfork
Copy link

+1 (enterprise customer)

@roy
Copy link

roy commented Jan 21, 2015

+1

@jmscholen
Copy link

+1, enterprise.

@saadtazi
Copy link

saadtazi commented Feb 7, 2015

+1

1 similar comment
@aletourneau
Copy link

+1

@OnixGH
Copy link
Contributor

OnixGH commented Dec 20, 2016

@msva are you not able to use a logging framework?

@edi
Copy link

edi commented Dec 20, 2016

@OnixGH We're sorry, we ain't that smart as you are. cough

@OnixGH
Copy link
Contributor

OnixGH commented Dec 20, 2016

@Eduardjs what do you mean? I wasn't being sarcastic, I just wonder why using a logging framework isn't a good workaround, since they are generally recommended anyway, as well as dedicated to this purpose (so probably offer more flexibility)?

I can understand the case that it would be a great thing to have available "by default" (through Passenger), so you don't have to use anything else for the simple logging needs, but it somehow seems like @msva is blocked by not having it so I'm interested in why a logging framework (apparently?) isn't an option.

Anyway keep it nice please..

@OnixGH OnixGH changed the title Per-application log files Per-application log files for Apache/Nginx integration mode Dec 20, 2016
@msva
Copy link

msva commented Dec 20, 2016 via email

@OnixGH
Copy link
Contributor

OnixGH commented Dec 20, 2016

@msva we need to take into account that Passenger is also used with Apache as well as in reverse proxy setups. I don't see anything about node in this thread, but can you say something about your own use case? People in this thread are asking for different things (which are not always compatible) so it's most valuable to know the use cases.

Btw. last month I tried something that might be relatively easy to implement, in line with what @wyardley suggested. We could prefix the app's stdout/stderr logging with application group name like in the example below (/home/test/apps/nodejs/simple/public (development)). By default that's the full path + environment, but you can already configure group names to something custom if you want to shorten.

=============== Phusion Passenger Standalone web server started ===============
PID file: /home/test/apps/nodejs/simple/passenger.3000.pid
Log file: /home/test/apps/nodejs/simple/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/
===============================================================================
[ 2016-11-10 12:16:45.7121 9348/7f0609c59780 age/Cor/CoreMain.cpp:817 ]: Passenger core online, PID 9348
App 885 /home/test/apps/nodejs/simple/public (development) stdout: 
App 885 /home/test/apps/nodejs/simple/public (development) stdout: Simple app listening on port 2000!
App 885 /home/test/apps/nodejs/simple/public (development) stdout: GOT REQUEST
App 885 /home/test/apps/nodejs/simple/public (development) stdout: { connection: 'close',
App 885 /home/test/apps/nodejs/simple/public (development) stdout:   host: '0.0.0.0',
App 885 /home/test/apps/nodejs/simple/public (development) stdout:   'x-forwarded-for': '127.0.0.1',
App 885 /home/test/apps/nodejs/simple/public (development) stdout:   '!~passenger-client-address': '127.0.0.1' }

This would allow for per-(spawned)-application logs with a simple tailgrep (which could for example be started / stopped automatically using the attached_process / detached_process hooks.

@wyardley
Copy link

FWIW, we mostly just use Winston + syslog transport with node projects that we run through Passenger (though I'd still love to see a more elegant fix for this problem as well).

@Wardrop
Copy link

Wardrop commented Jan 25, 2017

+1 I've been wanting this for a long time.

@vaivars
Copy link

vaivars commented Feb 13, 2017

+1

As for the requests for "unified" with nginx directives - i think that isn't necessary if atleast the current passenger_log directive would instead of being global - be app specific would be enough.

@msva
Copy link

msva commented Sep 5, 2017

Is it any progress?

The issue has been reported 3 years ago, and it has [Priority/High] and [EnterpriseCustomer] tags for 1.5 years already, but looks like still not fixed in any way 😿

P.S. @OnixGH, mostly, people (including me) just want that passenger either obey nginx access_log/error_log directives, or had the possibility to set passenger_log on per-server{} and per-location{} level.
So, each application will use separated logs without tons of kludges from user side (global passenger troubles can still go to the per-http{} log).

@OnixGH
Copy link
Contributor

OnixGH commented Sep 5, 2017

@msva I know it's not what you want to hear, but we don't consider it something that is broken, especially not since there are workarounds to achieve per-application log separation through additional tools (logging libraries, parse/forwarders,, etc.).

We did recently spend some rewriting effort in the logging department to make some parts easier (leading to a bonus of supporting log level display), but the core of the matter is that log separation is not something that is easy to realize (which is probably also why, despite the apparent popularity, we also haven't really gotten any patch submissions :( ).

I keep the Prio label on to make sure it has our (continued) attention (and it certainly does), but I also want to be clear that there is no roadmap for this feature at this time, We are hiring though to further expand what we can spend on Passenger :).

@OnixGH
Copy link
Contributor

OnixGH commented Apr 4, 2018

This feature is now available in the Fuse Panel.

@iDoMeteor
Copy link

iDoMeteor commented Apr 4, 2018 via email

@OnixGH OnixGH added this to the 5.3.0 milestone May 9, 2018
@OnixGH
Copy link
Contributor

OnixGH commented May 9, 2018

And also added to Passenger 5.3.0 (Enterprise).

@OnixGH OnixGH closed this as completed May 9, 2018
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