【问题标题】:Use Logback access with Grails 3 webapp (Springboot) application deployed with java -jar对使用 java -jar 部署的 Grails 3 webapp (Springboot) 应用程序使用 Logback 访问
【发布时间】:2016-09-24 11:15:02
【问题描述】:

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

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

【问题讨论】:

    标签: tomcat spring-boot logback grails-3.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)'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-14
      • 1970-01-01
      • 1970-01-01
      • 2012-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多