我已经用野蝇群创建了一个RestApplication。应用程序日志记录与log4j2配合使用得很好。但我不知道,我如何才能为我的应用程序启用访问日志。
我不能将jboss-web.xml用于阀门,因为它将不受支持!我知道,我可以通过编程来创建群集,如下所示:
ClassLoader cl = Main.class.getClassLoader();
URL xmlConfig = cl.getResource("standalone.xml");
Swarm swarm = new Swarm(false)
.withXmlConfig(xmlConfig);
[...]还有没有其他提示,像jboss-web.xml这样的声明式xml?
提前致谢&致以最良好的敬意
单
发布于 2016-11-24 02:44:54
访问日志配置在Undertow中。您需要使用UndertowFraction来启用它。就像这样
final UndertowFraction fraction = UndertowFraction.createDefaultFraction();
fraction.subresources()
.server("default-server")
.subresources()
.host("default-host")
.accessLogSetting(new AccessLogSetting().useServerLog(true));https://stackoverflow.com/questions/40746452
复制相似问题