How to enable embedded tomcat logging

前端 未结 5 1567
隐瞒了意图╮
隐瞒了意图╮ 2021-01-22 23:36

I m using embedded tomcat in my java application. below is my source code. however tomcat is not generating any log.

        embedded = new Embedded();
        e         


        
5条回答
  •  猫巷女王i
    2021-01-23 00:21

    Here is what worked for me (Tomcat 9.0.38):

    Add system property to point to my logging config:

    -Djava.util.logging.config.file=/absolute/path/to/logging.properties
    

    And the contents of logging.properties is:

    java.util.logging.ConsoleHandler.level = FINE
    java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
    java.util.logging.ConsoleHandler.encoding = UTF-8
    handlers = java.util.logging.ConsoleHandler
    org.apache.coyote.http2.level = FINE
    

提交回复
热议问题