解决XML文件中的警告提示“No grammar constraints (DTD or XML Schema) referenced in the document.”

星期三, 2020-02-12 | Author: Lee | JAVA-and-J2EE | 3,520 views

在springboot项目中使用的自定义的xml文件,

但是显示警告信息“No grammar constraints (DTD or XML Schema) referenced in the document.”

解决如下:

#加上 <!DOCTYPE xml> 即可

示例:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<configuration debug="false">
    <springProperty scope="context" name="springAppName" source="spring.application.name"/>
 
    <!-- log maxFileSize -->
    <springProperty scope="context" name="MAX_FILE_SIZE" source="spring.logback.max-file-size" defaultValue="100MB"/>
 
    <!-- log maxIndex -->
    <springProperty scope="context" name="MAX_INDEX" source="spring.logback.max-index" defaultValue="5"/>
 
    <!-- log base path -->
    <property name="LOG_HOME" value="/opt/logs/pomelolee/applog"/>
 
    <!-- 控制台输出 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern>
        </encoder>
    </appender>
 
    <!-- 日志输出级别 -->
    <root level="INFO">
        <appender-ref ref="STDOUT" />
    </root>
 
</configuration>

Tags:

文章作者: Lee

本文地址: https://www.pomelolee.com/2026.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta