English 中文(简体)
Boo Springt Admin: 阅读日志: -
原标题:Spring Boot Admin: Error while reading logfile: -

When I m tapping on the log button corresponding to my application of spring boot admin dashboard I m getting Error while reading logfile: - error. Does somebody faced this already? I m using log4j with such configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="[%d{ABSOLUTE}] [%-5p] [%c{1}] [%t] [%m]%n"/>
        </layout>
    </appender>

    <appender name="file" class="org.apache.log4j.RollingFileAppender">
        <param name="append" value="false" />
        <param name="maxFileSize" value="10KB" />
        <param name="maxBackupIndex" value="5" />
        <param name="file" value="service-rest.log" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="[%d{ABSOLUTE}] [%-5p] [%c{1}] [%t] [%m]%n"/>
        </layout>
    </appender>

    <root>
        <priority value="DEBUG"/>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="file" />
    </root>
</log4j:configuration>

我的申请。 垃圾卷宗有这种伐木部分:

logging:
  file: "service-rest.log"
  level:
    org:
      springframework:
        boot:
          autoconfigure:
            logging: DEBUG

也可直接从<代码>http://url/actuator/logfile上查阅该日志。

问题回答

问题是推向<代码>服务-rest.log文档的日志格式略为错误。 档案中的权利

<appender name="file" class="org.apache.log4j.RollingFileAppender">
    <param name="append" value="false" />
    <param name="maxFileSize" value="10MB" />
    <param name="maxBackupIndex" value="5" />
    <param name="file" value="tvpp-rest.log" />
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] [%t] [%m]%n"/>
    </layout>
</appender>

不要在时间上和时间上加方括号。

在春布特3.x版本中,我使用<条码>logging.logback.rollingpolicy.max-file-size房地产,以提供日志尺寸,但在我搬走后,该财产被带走。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签