From 95dafe8eaedf270c639adf0e51481f0172d2b808 Mon Sep 17 00:00:00 2001 From: jrh3 Date: Wed, 23 Aug 2017 09:40:28 -0400 Subject: Add access.log to jetty server Added a single line to the code that creates the jetty server so that it will log messages in access.log format. Also added lines to various logback.xml files to actually write the output from the jetty server to the access.log. Made some revisions per comments: - removed spaces around parameters - added "Out" suffix - changed suffix of archived files - changed size to 1MB Modified logback*.xml files to include jetty "access log" content in the already-existing network.log. Issue-Id: POLICY-161 Change-Id: I3e3769c06a22aaffea0e09abbec3387cc62f246f Signed-off-by: jrh3 --- .../org/onap/policy/drools/http/server/internal/JettyServletServer.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'policy-endpoints/src/main/java') diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java index 66261349..55d058f5 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java @@ -25,6 +25,7 @@ import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.security.authentication.BasicAuthenticator; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.server.Slf4jRequestLog; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.security.Credential; @@ -134,6 +135,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable this.context.setContextPath(contextPath); this.jettyServer = new Server(); + this.jettyServer.setRequestLog(new Slf4jRequestLog()); this.connector = new ServerConnector(this.jettyServer); this.connector.setName(name); -- cgit 1.2.3-korg