求解,为什么我的logback报错

这个是配置文件
%-5level%logger{50}-%msg%n"/>
${log.pattern}
${log.filePath}/debug.log
${log.filePath}/debug/debug.%d{yyyy-MM-dd}.log.gz
${log.maxHistory}
INFO
ACCEPT
DENY
${log.filePath}/info.log
${log.filePath}/info/info.%d{yyyy-MM-dd}.log.gz
${log.maxHistory}
INFO
ACCEPT
DENY
${log.filePath}/error.log
${log.filePath}/error/error.%d{yyyy-MM-dd}.log.gz
${log.maxHistory}
INFO
ACCEPT
DENY
这个是报错日志
10:20:48,900|-ERRORinch.qos.logback.core.rolling.RollingFileAppender[debugAppender]-Noencodersetfortheappendernamed"debugAppender".10:20:48,900|-INFOinch.qos.logback.core.joran.action.AppenderAction-Abouttoinstantiateappenderoftype[ch.qos.logback.core.rolling.RollingFileAppender]10:20:48,900|-INFOinch.qos.logback.core.joran.action.AppenderAction-Namingappenderas[infoAppender]10:20:48,900|-INFOinc.q.l.core.rolling.TimeBasedRollingPolicy@905986454-Willusegzcompression10:20:48,900|-INFOinc.q.l.core.rolling.TimeBasedRollingPolicy@905986454-WillusethepatternC:/Users/36537/.IntelliJIdea2019.1/system/tomcat/Unnamed_o2o_3/logs/webapps/info/info.%d{yyyy-MM-dd}.logfortheactivefile10:20:48,900|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-Thedatepatternis'yyyy-MM-dd'fromfilenamepattern'C:/Users/36537/.IntelliJIdea2019.1/system/tomcat/Unnamed_o2o_3/logs/webapps/info/info.%d{yyyy-MM-dd}.log.gz'.10:20:48,900|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-Roll-overatmidnight.10:20:48,900|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-SettinginitialperiodtoFriMay1009:23:22CST201910:20:48,900|-INFOinch.qos.logback.core.rolling.RollingFileAppender[infoAppender]-Activelogfilename:C:Users36537.IntelliJIdea2019.1systemtomcatUnnamed_o2o_3/logs/webapps/info.log10:20:48,900|-INFOinch.qos.logback.core.rolling.RollingFileAppender[infoAppender]-Filepropertyissetto[C:Users36537.IntelliJIdea2019.1systemtomcatUnnamed_o2o_3/logs/webapps/info.log]10:20:48,900|-WARNinch.qos.logback.core.rolling.RollingFileAppender[infoAppender]-Encoderhasnotbeenset.Cannotinvokeitsinitmethod.10:20:48,900|-ERRORinch.qos.logback.core.rolling.RollingFileAppender[infoAppender]-Noencodersetfortheappendernamed"infoAppender".10:20:48,900|-INFOinch.qos.logback.core.joran.action.AppenderAction-Abouttoinstantiateappenderoftype[ch.qos.logback.core.rolling.RollingFileAppender]10:20:48,900|-INFOinch.qos.logback.core.joran.action.AppenderAction-Namingappenderas[errorAppender]10:20:48,900|-INFOinc.q.l.core.rolling.TimeBasedRollingPolicy@1482593465-Willusegzcompression10:20:48,900|-INFOinc.q.l.core.rolling.TimeBasedRollingPolicy@1482593465-WillusethepatternC:/Users/36537/.IntelliJIdea2019.1/system/tomcat/Unnamed_o2o_3/logs/webapps/error/error.%d{yyyy-MM-dd}.logfortheactivefile10:20:48,903|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-Thedatepatternis'yyyy-MM-dd'fromfilenamepattern'C:/Users/36537/.IntelliJIdea2019.1/system/tomcat/Unnamed_o2o_3/logs/webapps/error/error.%d{yyyy-MM-dd}.log.gz'.10:20:48,903|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-Roll-overatmidnight.10:20:48,903|-INFOinc.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy-SettinginitialperiodtoFriMay1009:23:22CST201910:20:48,904|-INFOinch.qos.logback.core.rolling.RollingFileAppender[errorAppender]-Activelogfilename:C:Users36537.IntelliJIdea2019.1systemtomcatUnnamed_o2o_3/logs/webapps/error.log10:20:48,904|-INFOinch.qos.logback.core.rolling.RollingFileAppender[errorAppender]-Filepropertyissetto[C:Users36537.IntelliJIdea2019.1systemtomcatUnnamed_o2o_3/logs/webapps/error.log]10:20:48,904|-WARNinch.qos.logback.core.rolling.RollingFileAppender[errorAppender]-Encoderhasnotbeenset.Cannotinvokeitsinitmethod.10:20:48,904|-ERRORinch.qos.logback.core.rolling.RollingFileAppender[errorAppender]-Noencodersetfortheappendernamed"errorAppender".10:20:48,904|-INFOinch.qos.logback.classic.joran.action.LoggerAction-Settingleveloflogger[com.imooc.o2o]toDEBUG10:20:48,904|-INFOinch.qos.logback.classic.joran.action.LoggerAction-Settingadditivityoflogger[com.imooc.o2o]totrue10:20:48,904|-INFOinch.qos.logback.core.joran.action.AppenderRefAction-Attachingappendernamed[infoAppender]toLogger[com.imooc.o2o]10:20:48,906|-INFOinch.qos.logback.core.joran.action.AppenderRefAction-Attachingappendernamed[debugAppender]toLogger[com.imooc.o2o]10:20:48,906|-INFOinch.qos.logback.core.joran.action.AppenderRefAction-Attachingappendernamed[errorAppender]toLogger[com.imooc.o2o]10:20:48,906|-INFOinch.qos.logback.classic.joran.action.RootLoggerAction-SettinglevelofROOTloggertoINFO10:20:48,906|-INFOinch.qos.logback.core.joran.action.AppenderRefAction-Attachingappendernamed[consoleAppender]toLogger[ROOT]10:20:48,906|-INFOinch.qos.logback.classic.joran.action.ConfigurationAction-Endofconfiguration.10:20:48,906|-INFOinch.qos.logback.classic.joran.JoranConfigurator@4d89bfc6-Registeringcurrentconfigurationassafefallbackpoint
这个erro,怎么解决,求解10:20:48,904|-ERRORinch.qos.logback.core.rolling.RollingFileAppender[errorAppender]-Noencodersetfortheappendernamed"errorAppender".
千万里不及你
浏览 1244回答 2
2回答

潇湘沐

没有日志格式吧%-4relative[%thread]%-5level%logger{35}-%msg%nlogFile.log....%-4relative[%thread]%-5level%logger{35}-%msg%n官网说明地址:appender

慕盖茨4494581

异常说的很明显,你的"debugAppender"配置里缺少encoder标签.在配置里加上%-4relative[%thread]%-5level%logger{35}-%msg%n
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript