JHipster - Log Files

前端 未结 6 1320
借酒劲吻你
借酒劲吻你 2021-02-06 04:50

I have a JHipster application running and I would like to know where are the logs files. Where are they generated ? (It\'s a newbie question, but can\'t find anything)

I

6条回答
  •  醉梦人生
    2021-02-06 05:13

    The src/main/resources/logback.xml file contains the JHipster logging configuration. For reference, there is an additional src/test/resources/logback-test.xml file that is used when running the unit tests.

    By default, JHipster logs only to the console. When running using the mvn spring-boot:run or gradlew bootRun (the default build targets), the only place your logs will appear is in the console window. However, if running inside a web container such as Tomcat, the web container might automatically save the logs to a container-specific location. For example, Tomcat saves all log messages printed to the console to [CATALINA_HOME]/logs/catalina.out.

    If you wish to reconfigure your application to print logs to a file, you can do so by uncommenting and customizing the FILE appender declaration in the logback configuration file mentioned above and then adding a reference to the FILE appender to the root logger. Example:

    ...
    
    
        
            logFile.%d{yyyy-MM-dd}.log
            90
        
        
            utf-8
            %d %-5level [%thread] %logger{0}: %msg%n
        
    
    
    ...
    
    
         
         
    
    
    ...
    

提交回复
热议问题