1

我有一个基本的 SpringBoot 2.0.5.RELEASE 应用程序。使用 Spring Initializer、JPA、嵌入式 Tomcat、Thymeleaf 模板引擎,并将其打包为可执行 JAR 文件和 Logback,旨在作为流行 log4j 项目的继承者,

但是应用程序。启动时被冻结,这是我在控制台中看到的:

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.5.RELEASE)

16:25:42,044 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.9.log.zip
16:25:42,054 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.8.log.zip
16:25:42,054 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.7.log.zip
16:25:42,059 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.6.log.zip
16:25:42,059 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.5.log.zip
16:25:42,060 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.4.log.zip
16:25:42,072 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.3.log.zip
16:25:42,072 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.2.log.zip
16:25:42,073 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.1.log.zip
16:25:42,075 |-INFO in ch.qos.logback.core.rolling.helper.Compressor - ZIP compressing [/root/logs/trivikramasana/trivikramasana-api.log] as [/root/logs/trivikramasana/trivikramasana-api.1.log.zip]
16:25:44,219 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.9.log.zip
16:25:44,219 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.8.log.zip
16:25:44,219 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.7.log.zip
16:25:44,220 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.6.log.zip
16:25:44,220 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.5.log.zip
16:25:44,220 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.4.log.zip
16:25:44,220 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.3.log.zip
16:25:44,220 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.2.log.zip
16:25:44,220 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.1.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.2.log.zip]
16:25:44,222 |-INFO in ch.qos.logback.core.rolling.helper.Compressor - ZIP compressing [/root/logs/trivikramasana/trivikramasana-api.log] as [/root/logs/trivikramasana/trivikramasana-api.1.log.zip]
16:25:46,372 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.9.log.zip
16:25:46,376 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.8.log.zip
16:25:46,376 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.7.log.zip
16:25:46,376 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.6.log.zip
16:25:46,376 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.5.log.zip
16:25:46,377 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.4.log.zip
16:25:46,377 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.3.log.zip
16:25:46,377 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.2.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.3.log.zip]
16:25:46,377 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.1.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.2.log.zip]
16:25:46,377 |-INFO in ch.qos.logback.core.rolling.helper.Compressor - ZIP compressing [/root/logs/trivikramasana/trivikramasana-api.log] as [/root/logs/trivikramasana/trivikramasana-api.1.log.zip]
16:25:48,240 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.9.log.zip
16:25:48,242 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.8.log.zip
16:25:48,243 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.7.log.zip
16:25:48,245 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.6.log.zip
16:25:48,249 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.5.log.zip
16:25:48,252 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5e025e70 - Skipping roll-over for inexistent file /root/logs/trivikramasana/trivikramasana-api.4.log.zip
16:25:48,254 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.3.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.4.log.zip]
16:25:48,255 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.2.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.3.log.zip]
16:25:48,256 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/root/logs/trivikramasana/trivikramasana-api.1.log.zip] to [/root/logs/trivikramasana/trivikramasana-api.2.log.zip]
16:25:48,256 |-INFO in ch.qos.logback.core.rolling.helper.Compressor - ZIP compressing [/root/logs/trivikramasana/trivikramasana-api.log] as [/root/logs/trivikramasana/trivikramasana-api.1.log.zip]

这是我的 logback.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">

    <property resource="application.properties"/>

    <!-- trace, debug, info, warn, error, fatal -->
    <timestamp key="myTimestamp" datePattern="yyyy-MM-dd'_'HH-mm-ss.SSS"/>  


    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
        <resetJUL>true</resetJUL>
    </contextListener>

    <!-- To enable JMX Management -->
    <jmxConfigurator/>

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{"yyyy-MM-dd HH:mm"}  [%thread] %-5level %logger{35} - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${user.home}/${logfile.path}/${logfile.name}.log</file> 

        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${user.home}/${logfile.path}/${logfile.name}.%i.log.zip</fileNamePattern>             
            <minIndex>1</minIndex>
            <maxIndex>10</maxIndex>
        </rollingPolicy>

        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>1MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>%d{"yyyy-MM-dd HH:mm"} [%thread] %-5level %logger{35} - %msg%n</pattern>
        </encoder>
    </appender>



    <!-- <logger name="org.springframework.orm.jpa"     level="debug" /> -->    
    <logger name="com.trivikramasana"       level="debug" />
    <logger name="uk.co.jemos.podam"    level="warn" />
    <logger name="org.thymeleaf"        level="info" />
    <logger name="org.springframework"  level="info" />
    <logger name="org.hibernate"        level="info" />
    <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="warn" />
    <logger name="org.springframework.web"      level="info" />
    <logger name="org.springframework.security" level="info" />

    <root level="debug">
        <!--appender-ref ref="CONSOLE" /-->
        <appender-ref ref="FILE" />
    </root>
</configuration>
4

1 回答 1

0

我不认为该应用程序被冻结。查看您的 logs/logback 配置,日志被重定向到 FILE appender,除了 package ch.qos.logback.core

所以应用程序应该正在运行并在文件中注销。如果有任何问题,则应将其记录RollingFileAppenderlogback.xml.

冷冻一定不是状态。它要么崩溃,要么正在运行。日志应该更多地说明它。

于 2018-11-26T06:53:41.950 回答