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

Make LoggingFilter Generic #143

Closed
mosesn opened this issue Mar 13, 2013 · 3 comments
Closed

Make LoggingFilter Generic #143

mosesn opened this issue Mar 13, 2013 · 3 comments
Assignees

Comments

@mosesn
Copy link
Contributor

mosesn commented Mar 13, 2013

motivation

The code for LoggingFilter is already extremely generic, but it only works for Http, basically because it was written for finagle-http. My proposal is to finagle it to work for any protocol.

I was implementing a generic LoggingFilter, and realized that it was basically a copy of the http version, which seems dumb. I think it's a pretty useful thing, and I'd like to be able to use the raw finagle version.

proposed implementation

Move the LoggingFilter and LogFormatter code over to finagle-core making them generic, and leave a LoggingFilter and LogFormatter in finagle-http, but marked as deprecated. Bump the minor version. In the next major version, strip the http versions.

We should also add a logError method to the LoggingFilter class, so that we can log exceptions differently from completions.

The proposed method signature for logError would be

def logError(responseTime: Duration, request: Req, error: Throwable)

who

I'd be happy to do it, and will assign it to myself after we've reached a consensus on what we want to do.

misc

I'm interested in hearing suggestions, or reasons why we don't want to do this.

@stevegury
Copy link
Contributor

Sorry for the delay again.

We would be happy to see your pull request on this.
No need to bump the minor, if you leave the old LogFormatter in com.twitter.finagle.http.filter, there shouldn't be any API breakage.

I agree with the rest of your proposition, maybe should you use logException instead of logError (I'm fine with both).

@mosesn
Copy link
Contributor Author

mosesn commented Mar 17, 2013

Alright, I made a pull request, the api changed slightly, I described the change in my PR. Changed to logException.

@stevegury
Copy link
Contributor

Closing, the fix is in our internal repo, it should show up here soon.

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

No branches or pull requests

2 participants