0

I have created a RestApplication with wildfly-swarm. the application logging works well with the log4j2. But i do not know, how can i any enable the access-log for my application.

i could not use jboss-web.xml with valves, because it will not be supported! i know, i can create the swarm programmatically like:

ClassLoader cl = Main.class.getClassLoader();
URL xmlConfig = cl.getResource("standalone.xml");

Swarm swarm = new Swarm(false)
        .withXmlConfig(xmlConfig);

[...]

any other tipps, declaratively xml like jboss-web.xml?

thanks in advance & best regards

Shan

shan
  • 112
  • 1
  • 9

1 Answers1

0

Access logs are configured in Undertow. You'd need to use the UndertowFraction to enable it. Something like

final UndertowFraction fraction = UndertowFraction.createDefaultFraction();
fraction.subresources()
        .server("default-server")
        .subresources()
        .host("default-host")
        .accessLogSetting(new AccessLogSetting().useServerLog(true));
James R. Perkins
  • 16,800
  • 44
  • 60