1

如何配置使用 logback 作为默认日志框架来记录HTTP嵌入式 tomcat 的请求的 grails 3,就像 tomcat 应用程序服务器在创建日志访问日志文件时所做的那样?

我知道我必须使用logback 访问模块,但据说它适用于部署容器,例如 tomcat 和 jetty

4

1 回答 1

1

我的 Grails 3 应用程序使用了以下依赖项:

org.springframework.boot:spring-boot-starter-tomcat

快速搜索让我找到:http ://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html

所以我的 application.yml 文件现在包含如下块:

server:
    tomcat:
        basedir: '.'
        accesslog:
            enabled: true
            pattern: '%t %a %u "%r" %s (%D ms)'
于 2016-09-22T09:04:56.513 回答