如何在 Spring Boot 中启用 appication.properties 中的 undertow 登录

Posted

技术标签:

【中文标题】如何在 Spring Boot 中启用 appication.properties 中的 undertow 登录【英文标题】:How to enable undertow log in appication.properties in Spring boot 【发布时间】:2016-02-18 01:11:45 【问题描述】:

undertow中spring boot提供的嵌入式tomcat服务器如何开启http服务器日志?我已经在 application.properties 中尝试过,但它没有创建文件,也没有记录到控制台

我正在寻找类似的东西 Spring Boot enable http requests logging

任何帮助将不胜感激。

谢谢

【问题讨论】:

【参考方案1】:
server.undertow.accesslog.enabled=true
server.undertow.accesslog.pattern=%t %a "%r" %s (%D ms)

在 application.properties 中添加此代码

【讨论】:

以上是关于如何在 Spring Boot 中启用 appication.properties 中的 undertow 登录的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Spring Boot 和 Angular 中启用 CORS

如何在 Spring Boot 中启用 HTTP 响应缓存

如何在 Spring Boot 中启用浏览器缓存

如何使用 Thymeleaf 或 JSP 在 Spring Boot 中启用目录列表

如何在 Spring Boot 中启用 H2 数据库服务器模式

如何在 Spring Boot 库中启用 H2 控制台?