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

Get rid of Spring dependency #4

Closed
whiskeysierra opened this issue Sep 26, 2015 · 2 comments
Closed

Get rid of Spring dependency #4

whiskeysierra opened this issue Sep 26, 2015 · 2 comments

Comments

@whiskeysierra
Copy link
Collaborator

Right now the only reason to have Spring as a direct dependency is that we use the OncePerRequestFilter which in turn is just an implementation detail.

Other than that we are just providing a servlet filter that, in theory, would work with any other framework just as good, as long as it's running in a servlet container.

That would mean we change the scope (and the name) to something more generic, e.g servlet-logging. Which got me thinking - we're probably not the first ones to do something like this.

I've found:

Most of them are either just a proof of concept or too tightly coupled to a certain logging framework. But I think we can steal some ideas from them.

For example logback-access by default logs full requests/responses like this:

GET /logback-demo/index.jsp HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20070312 Firefox/1.5.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:8080/logback-demo/login.jsp
Cookie: JSESSIONID=15c7tqi9ehlwk;  OID324nkzcmr=null; OID32862zgoa=null; 



HTTP/1.1 200 OK
Content-Type: text/html; charset=iso-8859-1
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=bgebt99ce9om;path=/logback-demo


<html>
<head>
        <LINK REL=StyleSheet HREF="css/pk.css" />
</head>
<body>

<h2>Logback demo center</h2>

[snip, so that text is reasonably sized]

If you combine this with color-coded console output, one could e.g. produce log output that looks like httpie which would be pretty cool for local development.

@whiskeysierra
Copy link
Collaborator Author

What about Logbook as a project name?

@lukasniemeier-zalando
Copy link
Member

Easy to find a nice wallpaper for this name, so 👍

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

No branches or pull requests

2 participants