This module add an Interceptor to Karyon so that log all requests.
First of all, add to your build.gradle the dependency as usually do, for example:
dependencies {
...
compile 'com.scmspain.karyon:karyon2-accesslog:x.x.x'
}
Remember to check the maven central badge to get the latest version.
Then include AccessLogModule in your AppServer as follows:
...
@Modules(
include = {
...
AccessLogModule.class
})
public interface AppServer {
...
}
And finally intercept all urls:
@Override
protected void configureServer() {
...
interceptorSupport().forUri("/*").intercept(AccessLogInterceptor.class);
}
By default CombinedApacheLog format is bind, but you can override this in your module as follows:
@Override
protected void configure() {
...
binder.bind(AccessLogFormatter.class).to(JsonLog.class);
}