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

Update logging.js #491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update logging.js #491

wants to merge 1 commit into from

Conversation

tarnazar
Copy link

May be something like that? For nginx proxy.

May be something like that? For nginx proxy.
@ghost
Copy link

ghost commented Nov 19, 2013

This is the perfect opportunity to inject an idea of custom logging that would be tailored for each specific setup. Then, users could design a log system unique to his/her needs.

The fallback to using the header "x-forwarded-for" works well for nginx and many systems, but not for every use case.

Thoughts?

@ghost
Copy link

ghost commented Nov 19, 2013

Maybe some async method that is given response/request params from each http/https invocation — call. It would obviously be abstracted from the request and independent, implying the http/https call doesn't need to wait until the log has completed.

@mde
Copy link
Contributor

mde commented Nov 19, 2013

We have an open issue for custom logging: #387 Right now we're logging in the standard Apache format. If we change it it would be awesome if it's this sort of customized logging we've been talking about. I'd definitely merge a PR that does this. We could discuss that here, on the original ticket, or in the #geddy IRC channel on Freenode.

@mde
Copy link
Contributor

mde commented Nov 19, 2013

A couple of additional points:

@ghost
Copy link

ghost commented Nov 19, 2013

All this sounds wonderful, apologies for diverting the logging conversation in this thread. The Apache format is formal and normalized which appears to be the best route.

Also, where would the logging methods be implemented into the architecture, global, controller specific, anywhere else?

@mde
Copy link
Contributor

mde commented Nov 19, 2013

There are two parts to the logging question:

  1. The log formatting. That is happening right here:

https://github.com/mde/geddy/blob/master/lib/app/logging.js#L32

For starters, we'd like that customizable, probably by adding another standard geddy.config value.

  1. The actual logging output. Eventually we'd like the logging configurable so you could output to whatever logger you want (including remote logging via HTTP, etc.). The logger is set up in the master process, since we aggregate all the logs from the child proccess:

https://github.com/mde/geddy/blob/master/lib/cluster/master.js#L43

We would want an API call exposed on the geddy global that allows you to point that output at whatever logger you want.

Happy to provide more specifics if people want to dive in and start work on this.

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

Successfully merging this pull request may close these issues.

None yet

2 participants