hammock icon indicating copy to clipboard operation
hammock copied to clipboard

Apache Combined Log Format output

Open derekm opened this issue 7 years ago • 4 comments

It would be really slick if Hammock could produce NCSA/Apache Common Log Format and/or Combined Log Format for its web-spi-using modules via log4j.

Jetty, for example, supports common & combined log formats thusly: https://stackoverflow.com/questions/19458875/how-do-i-configure-embedded-jetty-server-to-log-all-requests

derekm avatar Jan 24 '18 04:01 derekm

What if, I can look for a bean of type RequestLog and set that on the jetty instance? I'm not sure there's an equivalent for undertow. Or maybe I don't get what you're saying quite yet.

johnament avatar Jan 28 '18 21:01 johnament

Or if there's a way to log generically for all web-spi users where the system administrator has an easy way to define access_log and error_log files in the style of an old school Apache HTTP Server.

Like something webalizer or awstats could parse.

derekm avatar Jan 28 '18 22:01 derekm

Oh ok, I see what you want to do now. I know how to do this in undertow, and you've linked to how to do it in jetty. Need to see how tomcat does it. But should be doable.

johnament avatar Jan 28 '18 23:01 johnament

The way this answer shows a log4j wrapper might be a neat way to go about it: https://stackoverflow.com/a/38783338

derekm avatar Jan 28 '18 23:01 derekm