13:19:14.437 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener -Application failed to start with classpath: [file:/D:/Software/jdk/jre/lib/charsets.jar, file:/D:/Software/jdk/jre/lib/deploy.jar, file:/D:/Software/jdk/jre/lib/ext/access-bridge-64.jar, file:/D:/Software/jdk/jre/lib/ext/cldrdata.jar, file:/D:/Software/jdk/jre/lib/ext/dnsns.jar, file:/D:/Software/jdk/jre/lib/ext/jaccess.jar, file:/D:/Software/jdk/jre/lib/ext/jfxrt.jar, file:/D:/Software/jdk/jre/lib/ext/localedata.jar, file:/D:/Software/jdk/jre/lib/ext/nashorn.jar, file:/D:/Software/jdk/jre/lib/ext/sunec.jar, file:/D:/Software/jdk/jre/lib/ext/sunjce_provider.jar, file:/D:/Software/jdk/jre/lib/ext/sunmscapi.jar, file:/D:/Software/jdk/jre/lib/ext/sunpkcs11.jar, file:/D:/Software/jdk/jre/lib/ext/zipfs.jar, file:/D:/Software/jdk/jre/lib/javaws.jar, file:/D:/Software/jdk/jre/lib/jce.jar, file:/D:/Software/jdk/jre/lib/jfr.jar, file:/D:/Software/jdk/jre/lib/jfxswt.jar, file:/D:/Software/jdk/jre/lib/jsse.jar, file:/D:/Software/jdk/jre/lib/management-agent.jar, file:/D:/Software/jdk/jre/lib/plugin.jar, file:/D:/Software/jdk/jre/lib/resources.jar, file:/D:/Software/jdk/jre/lib/rt.jar, file:/D:/MyDocument/WebService/demo1/target/classes/, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/2.1.5.RELEASE/spring-boot-starter-thymeleaf-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.5.RELEASE/spring-boot-starter-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot/2.1.5.RELEASE/spring-boot-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.5.RELEASE/spring-boot-autoconfigure-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.1.5.RELEASE/spring-boot-starter-logging-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/C:/Users/guoxw/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/C:/Users/guoxw/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.11.2/log4j-to-slf4j-2.11.2.jar, file:/C:/Users/guoxw/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar, file:/C:/Users/guoxw/.m2/repository/org/slf4j/jul-to-slf4j/1.7.26/jul-to-slf4j-1.7.26.jar, file:/C:/Users/guoxw/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar, file:/C:/Users/guoxw/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar, file:/C:/Users/guoxw/.m2/repository/org/thymeleaf/thymeleaf-spring5/3.0.11.RELEASE/thymeleaf-spring5-3.0.11.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/thymeleaf/thymeleaf/3.0.11.RELEASE/thymeleaf-3.0.11.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/unbescape/unbescape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar, file:/C:/Users/guoxw/.m2/repository/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.4.RELEASE/thymeleaf-extras-java8time-3.0.4.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.1.5.RELEASE/spring-boot-starter-web-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.1.5.RELEASE/spring-boot-starter-json-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.8/jackson-datatype-jdk8-2.9.8.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.8/jackson-datatype-jsr310-2.9.8.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.8/jackson-module-parameter-names-2.9.8.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.1.5.RELEASE/spring-boot-starter-tomcat-2.1.5.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.19/tomcat-embed-core-9.0.19.jar, file:/C:/Users/guoxw/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.19/tomcat-embed-el-9.0.19.jar, file:/C:/Users/guoxw/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.19/tomcat-embed-websocket-9.0.19.jar, file:/C:/Users/guoxw/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.16.Final/hibernate-validator-6.0.16.Final.jar, file:/C:/Users/guoxw/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar, file:/C:/Users/guoxw/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar, file:/C:/Users/guoxw/.m2/repository/com/fasterxml/classmate/1.4.0/classmate-1.4.0.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-web/5.1.7.RELEASE/spring-web-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-beans/5.1.7.RELEASE/spring-beans-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-webmvc/5.1.7.RELEASE/spring-webmvc-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-aop/5.1.7.RELEASE/spring-aop-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-context/5.1.7.RELEASE/spring-context-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-expression/5.1.7.RELEASE/spring-expression-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-core/5.1.7.RELEASE/spring-core-5.1.7.RELEASE.jar, file:/C:/Users/guoxw/.m2/repository/org/springframework/spring-jcl/5.1.7.RELEASE/spring-jcl-5.1.7.RELEASE.jar, file:/D:/Software/IntelliJIdea/IntelliJIDEA/lib/idea_rt.jar]
13:19:14.670 [main] ERROR org.springframework.boot.SpringApplication -Application run failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:55 - RuntimeException in Action for tag [property] java.lang.StringIndexOutOfBoundsException: String index out of range: 15
ERROR in ch.qos.logback.core.joran.spi.Interpreter@76:32 - no applicable action for [spring-profile], current ElementPath is [[configuration][spring-profile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@77:59 - no applicable action for [property], current ElementPath is [[configuration][spring-profile][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@80:32 - no applicable action for [spring-profile], current ElementPath is [[configuration][spring-profile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@81:59 - no applicable action for [property], current ElementPath is [[configuration][spring-profile][property]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:169)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:82)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:117)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:292)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:265)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:228)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:201)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.example.demo1.Demo1Application.main(Demo1Application.java:10)
Exception in thread "main" java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:55 - RuntimeException in Action for tag [property] java.lang.StringIndexOutOfBoundsException: String index out of range: 15
ERROR in ch.qos.logback.core.joran.spi.Interpreter@76:32 - no applicable action for [spring-profile], current ElementPath is [[configuration][spring-profile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@77:59 - no applicable action for [property], current ElementPath is [[configuration][spring-profile][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@80:32 - no applicable action for [spring-profile], current ElementPath is [[configuration][spring-profile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@81:59 - no applicable action for [property], current ElementPath is [[configuration][spring-profile][property]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:169)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:82)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:117)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:292)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:265)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:228)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:201)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.example.demo1.Demo1Application.main(Demo1Application.java:10)

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName>
<!--
<property name="LOG_HOME" value="/gather-logs/"></property>
-->
<!--输出到控制台-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger -%msg%n</pattern>
</encoder>
</appender> <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>C:\gather-logs\crm-info.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>C:\gather-logs\server-info-%d{yyyyMMdd}.log.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>2</maxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger -%msg%n</Pattern>
</layout>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%date{yyyy-MM-dd HH:mm:ss} | %highlight(%-5level) | %boldYellow(%thread) | %boldGreen(%logger) |
%msg%n
</pattern>
</encoder> </appender> <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<File>C:\gather-logs\crm-error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>C:\gather-logs\server-error-%d{yyyyMMdd}.log.%i
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>2</maxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger -%msg%n
</Pattern>
</layout>
</appender> <!-- <logger name="com.example.demo1.controller" level="INFO">--> <!-- </logger>--> <root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root> <!-- TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF -->
<logger name="org.springframework" level="DEBUG" additivity="true"/> <logger name="org.apache" level="OFF"/>
<logger name="com.alibaba" level="OFF"/>
<!-- 如果这里设置了additivity=true 代码打印信息向上传递,将打印信息传递到root ,并且自己的appender-ref 也会打印,这样就是打印了俩次日志-->
<logger name="com.example.demo1" level="INFO" additivity="true">
<appender-ref ref="console"/>
</logger> <!--
<spring-profile name="dev">
<property name="LOG_NAME" value="C:/gather-logs/"></property>
</spring-profile> <spring-profile name="prd">
<property name="LOG_NAME" value="D:/gather-logs/"></property>
</spring-profile>--> </configuration>

 

sping:
profiles:
active: dev 

异常:logback-spring.xml 加上 如下的property 加报错?

    <property name="LOG_HOME" value="/gather-logs/"></property>

原因?

Spring 错误日志的更多相关文章

  1. Spring MVC自定义统一异常处理类,并且在控制台中输出错误日志

    在使用SimpleMappingExceptionResolver实现统一异常处理后(参考Spring MVC的异常统一处理方法), 发现出现异常时,log4j无法在控制台输出错误日志.因此需要自定义 ...

  2. 十四、Spring Boot 日志记录 SLF4J

    在开发中打印内容,使用 System.out.println() 和 Log4j 应当是人人皆知的方法了. 其实在开发中我们不建议使用 System.out 因为大量的使用 System.out 会增 ...

  3. 【ELK】5.spring boot日志集成ELK,搭建日志系统

    阅读前必看: ELK在docker下搭建步骤 spring boot集成es,CRUD操作完整版 ============================================== 本章集成 ...

  4. Spring Boot 日志记录 SLF4J

    Spring Boot 日志记录 SLF4J 2016年01月12日 09:25:28 阅读数:54086 在开发中打印内容,使用 System.out.println() 和 Log4j 应当是人人 ...

  5. Spring错误异常重试框架guava-retrying

    官网:https://github.com/rholder/guava-retrying Maven:https://mvnrepository.com/artifact/com.github.rho ...

  6. 50. Spring Boot日志升级篇—log4j【从零开始学Spring Boot】

    如果你使用的是spring boot 1.4.0版本的话,那么你可能需要配合以下文章进行学习 90.Spring Boot 1.4 使用log4j错误[从零开始学Spring Boot] Log4j是 ...

  7. 启动tomcat报错One or more listeners failed to start,却找不到任何错误日志的临时解决方案

    在整合spring和quartz时,启动tomcat,服务台报以上错误,却找不到任何错误日志…… 参考了https://www.cnblogs.com/sxdcgaq8080/p/8005886.ht ...

  8. Spring Boot 日志各种使用姿势,是时候捋清楚了!

    @ 目录 1. Java 日志概览 1.1 总体概览 1.2 日志级别 1.3 综合对比 1.4 最佳实践 2. Spring Boot 日志实现 2.1 Spring Boot 日志配置 2.2 L ...

  9. ELK处理Spring Boot 日志,妙!

    在排查线上异常的过程中,查询日志总是必不可缺的一部分.现今大多采用的微服务架构,日志被分散在不同的机器上,使得日志的查询变得异常困难. 工欲善其事,必先利其器.如果此时有一个统一的实时日志分析平台,那 ...

随机推荐

  1. java面试题(转)

    1.面向对象的特征有哪些方面?答:面向对象的特征主要有以下几个方面:- 抽象:抽象是将一类对象的共同特征总结出来构造类的过程,包括数据抽象和行为抽象两方面.抽象只关注对象有哪些属性和行为,并不关注这些 ...

  2. 第一节:web爬虫之requests

    Requests库是用Python编写的,并且Requests是一个优雅而简单的Python HTTP库,在使用Requests库时更加方便,可以节约我们大量的工作,完全满足HTTP测试需求.

  3. Maven学习总结(7)——eclipse中使用Maven创建Web项目

    Maven学习总结(七)--eclipse中使用Maven创建Web项目 一.创建Web项目 1.1 选择建立Maven Project 选择File -> New ->Project,如 ...

  4. Macbook上安装Win7经验总结

    昨天兴致突发,想在Macbook上装个win7跑双系统玩玩,结果遇到了几个非常奇葩的问题.折腾了差不多一天,硬盘分区又合并分区N次,若干次卡死,最后总算搞定.记录下经验,以慰后来人. 问题一:安装程序 ...

  5. Sencha Toucha 2.1 文件上传

    javascript代码: Ext.onReady(function() { Ext.create('Ext.form.Panel', { title: 'Upload a Photo', width ...

  6. PatentTips - Fair scalable reader-writer mutual exclusion

    BACKGROUND The present invention relates generally to multithreaded programming and, more specifical ...

  7. 配置sublime text 前端环境

    SublimeLinter是Sublime的一个代码检测工具插件.安装前台是配置好node环境 1,在sublime text安装 SublimeLinter 按下 Ctrl+Shift+p 进入 C ...

  8. Spring Boot使用thymeleaf模板时报异常:template might not exist or might not be accessible by any of the configured Template Resolvers

    错误如下: template might not exist or might not be accessible by any of the configured Template Resolver ...

  9. DELPHI RTTI实现非可视的功能插件

    思路:通过数据字典定义BPL包名,然后定义BPL包里面的类名,然后定义类里面的方法名,最后定义方法的参数值. 可实现动态加载BPL,调用哪个BPL的哪个类的哪个方法并给该方法赋给指定的参数值,如果是函 ...

  10. HDU 4543

    这道题感觉很坑..不过,注意一些小问题. 参考http://www.cnblogs.com/Lattexiaoyu/archive/2013/03/31/2992553.html改进了原来自己的复杂度 ...