文件中没有输出日志控制台有

来源:3-3 验证配置

warren_au

2020-11-07

rator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)
at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32)
at at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5152)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1719)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:479)
at at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:428)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at at javax.management.remote.rmi.RMIConnectionImpl.access300(RMIConnectionImpl.java:76)atatjavax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76) at at javax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76)atatjavax.management.remote.rmi.RMIConnectionImplPrivilegedOperation.run(RMIConnectionImpl.java:1309)
at at java.security.AccessController.doPrivileged(Native Method)
at at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361)
at at sun.rmi.transport.Transport$1.run(Transport.java:200)
at at sun.rmi.transport.Transport1.run(Transport.java:197)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.Transport.serviceCall(Transport.java:196)atatsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)atatsun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197) at at java.security.AccessController.doPrivileged(Native Method) at at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at at sun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.Transport.serviceCall(Transport.java:196)atatsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)atatsun.rmi.transport.tcp.TCPTransportConnectionHandler.run0(TCPTransport.java:826)
at at sun.rmi.transport.tcp.TCPTransportConnectionHandler.lambdaConnectionHandler.lambdaConnectionHandler.lambdarun0(TCPTransport.java:683)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:683) at at java.security.AccessController.doPrivileged(Native Method) at at sun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:683)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.tcp.TCPTransportConnectionHandler.run(TCPTransport.java:682)
at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "log.MaxHistory_IS_UNDEFINED"
at at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at at java.lang.Integer.parseInt(Integer.java:580)
at at java.lang.Integer.(Integer.java:867)
at at ch.qos.logback.core.joran.util.StringToObjectConverter.convertArg(StringToObjectConverter.java:61)
at at ch.qos.logback.core.joran.util.PropertySetter.setProperty(PropertySetter.java:122)
at … 65 common frames omitted
16:09:55,716 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@263528386 - Will use gz compression
16:09:55,716 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@263528386 - Will use the pattern C:/Users/user/AppData/Local/JetBrains/IntelliJIdea2020.2/tomcat/Unnamed_o2o/logs/webapps/info/info.%d{yyyy-MM-dd}.log for the active file
16:09:55,717 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is ‘yyyy-MM-dd’ from file name pattern ‘C:/Users/user/AppData/Local/JetBrains/IntelliJIdea2020.2/tomcat/Unnamed_o2o/logs/webapps/info/info.%d{yyyy-MM-dd}.log.gz’.
16:09:55,717 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
16:09:55,717 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sat Nov 07 16:06:05 AEDT 2020
16:09:55,717 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:09:55,717 |-ERROR in ch.qos.logback.classic.PatternLayout(“null”) - Empty or null pattern.
16:09:55,718 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[infoAppender] - Active log file name: C:\Users\user\AppData\Local\JetBrains\IntelliJIdea2020.2\tomcat\Unnamed_o2o/logs/webapps/info.log
16:09:55,718 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[infoAppender] - File property is set to [C:\Users\user\AppData\Local\JetBrains\IntelliJIdea2020.2\tomcat\Unnamed_o2o/logs/webapps/info.log]
16:09:55,718 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
16:09:55,718 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [errorAppender]
16:09:55,718 |-WARN in ch.qos.logback.core.joran.util.PropertySetter@596b7c0f - Failed to set property [maxHistory] to value “log.MaxHistory_IS_UNDEFINED”. ch.qos.logback.core.util.PropertySetterException: Conversion to type [int] failed.
at ch.qos.logback.core.util.PropertySetterException: Conversion to type [int] failed.
at at ch.qos.logback.core.joran.util.PropertySetter.setProperty(PropertySetter.java:124)
at at ch.qos.logback.core.joran.util.PropertySetter.setProperty(PropertySetter.java:98)
at at ch.qos.logback.core.joran.action.NestedBasicPropertyIA.body(NestedBasicPropertyIA.java:95)
at at ch.qos.logback.core.joran.spi.Interpreter.callBodyAction(Interpreter.java:289)
at at ch.qos.logback.core.joran.spi.Interpreter.characters(Interpreter.java:172)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:57)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)
at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32)
at at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5152)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1719)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:479)
at at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:428)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at at javax.management.remote.rmi.RMIConnectionImpl.access300(RMIConnectionImpl.java:76)atatjavax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76) at at javax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76)atatjavax.management.remote.rmi.RMIConnectionImplPrivilegedOperation.run(RMIConnectionImpl.java:1309)
at at java.security.AccessController.doPrivileged(Native Method)
at at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:498)
at at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361)
at at sun.rmi.transport.Transport$1.run(Transport.java:200)
at at sun.rmi.transport.Transport1.run(Transport.java:197)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.Transport.serviceCall(Transport.java:196)atatsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)atatsun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197) at at java.security.AccessController.doPrivileged(Native Method) at at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at at sun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.Transport.serviceCall(Transport.java:196)atatsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)atatsun.rmi.transport.tcp.TCPTransportConnectionHandler.run0(TCPTransport.java:826)
at at sun.rmi.transport.tcp.TCPTransportConnectionHandler.lambdaConnectionHandler.lambdaConnectionHandler.lambdarun0(TCPTransport.java:683)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:683) at at java.security.AccessController.doPrivileged(Native Method) at at sun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:683)atatjava.security.AccessController.doPrivileged(NativeMethod)atatsun.rmi.transport.tcp.TCPTransportConnectionHandler.run(TCPTransport.java:682)
at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "log.MaxHistory_IS_UNDEFINED"
at at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at at java.lang.Integer.parseInt(Integer.java:580)
at at java.lang.Integer.(Integer.java:867)
at at ch.qos.logback.core.joran.util.StringToObjectConverter.convertArg(StringToObjectConverter.java:61)
at at ch.qos.logback.core.joran.util.PropertySetter.setProperty(PropertySetter.java:122)
at … 65 common frames omitted
16:09:55,718 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@671110460 - Will use gz compression
16:09:55,718 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@671110460 - Will use the pattern C:/Users/user/AppData/Local/JetBrains/IntelliJIdea2020.2/tomcat/Unnamed_o2o/logs/webapps/error/error.%d{yyyy-MM-dd}.log for the active file
16:09:55,718 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is ‘yyyy-MM-dd’ from file name pattern ‘C:/Users/user/AppData/Local/JetBrains/IntelliJIdea2020.2/tomcat/Unnamed_o2o/logs/webapps/error/error.%d{yyyy-MM-dd}.log.gz’.
16:09:55,718 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
16:09:55,719 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sat Nov 07 16:03:14 AEDT 2020
16:09:55,719 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
16:09:55,719 |-ERROR in ch.qos.logback.classic.PatternLayout(“null”) - Empty or null pattern.
16:09:55,719 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[errorAppender] - Active log file name: C:\Users\user\AppData\Local\JetBrains\IntelliJIdea2020.2\tomcat\Unnamed_o2o/logs/webapps/error.log
16:09:55,719 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[errorAppender] - File property is set to [C:\Users\user\AppData\Local\JetBrains\IntelliJIdea2020.2\tomcat\Unnamed_o2o/logs/webapps/error.log]
16:09:55,720 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.wjb.o2o] to DEBUG
16:09:55,721 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not find an appropriate class for property [appender]
16:09:55,721 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not find an appropriate class for property [appender]
16:09:55,721 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not find an appropriate class for property [appender]
16:09:55,721 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
16:09:55,721 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [consoleAppender] to Logger[ROOT]
16:09:55,721 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:09:55,722 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@b3b615e - Registering current configuration as safe fallback point

[2020-11-07 04:09:55,761] Artifact o2o:Web exploded: Artifact is deployed successfully
[2020-11-07 04:09:55,761] Artifact o2o:Web exploded: Deploy took 1,345 milliseconds
07-Nov-2020 16:10:04.278 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [E:\apache-tomcat-8.5.55\webapps\manager]
07-Nov-2020 16:10:04.296 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Web应用程序目录[E:\apache-tomcat-8.5.55\webapps\manager]的部署已在[18]毫秒内完成

配置





<!--控制台设置-->
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>${log.pattern}</pattern>
    </encoder>
</appender>

<!--DEBUG-->
<appender name="debugAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!-- 文件路径 -->
    <file>${log.filePath}/debug.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <!-- 文件名称 -->
        <fileNamePattern>${log.filePath}/debug/debug.%d{yyyy-MM-dd}.log.gz
        </fileNamePattern>
        <!-- 文件最大保存历史数量 -->
        <maxHistory>${log.maxHistory}</maxHistory>
    </rollingPolicy>
    <encoder>
        <pattern>${log.pattern}</pattern>
    </encoder>
    <filter class="ch.qos.logback.classic.filter.LevelFilter">
        <level>DEBUG</level>
        <onMatch>ACCEPT</onMatch>
        <onMismatch>DENY</onMismatch>
    </filter>
</appender>

<!--INFO-->
<appender name="infoAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!--文件路径-->
    <file>${log.filePath}/info.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <!--文件名称-->
        <fileNamePattern>
            ${log.filePath}/info/info.%d{yyyy-MM-dd}.log.gz
        </fileNamePattern>
        <!--文件最大保存历史数量-->
        <maxHistory>${log.MaxHistory}</maxHistory>
    </rollingPolicy>
    <encoder>${log.pattern}</encoder>
    <filter class="ch.qos.logback.classic.filter.LevelFilter">
        <level>INFO</level>
        <onMatch>ACCEPT</onMatch>
        <onMismatch>DENY</onMismatch>
    </filter>
</appender>

<!--ERROR-->
<appender name="errorAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!--文件路径-->
    <file>${log.filePath}/error.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <!--文件名称-->
        <fileNamePattern>
            ${log.filePath}/error/error.%d{yyyy-MM-dd}.log.gz
        </fileNamePattern>
        <!--文件最大保存历史数量-->
        <maxHistory>${log.MaxHistory}</maxHistory>
    </rollingPolicy>
    <encoder>${log.pattern}</encoder>
    <filter class="ch.qos.logback.classic.filter.LevelFilter">
        <level>ERROR</level>
        <onMatch>ACCEPT</onMatch>
        <onMismatch>DENY</onMismatch>
    </filter>
</appender>
<logger name="com.wjb.o2o" level="${log.level}" addtivity="true">
    <appender ref="debugAppender"/>
    <appender ref="infoAppender"/>
    <appender ref="errorAppender"/>
</logger>
<root level="info">
    <appender-ref ref="consoleAppender"/>
</root>
写回答

1回答

翔仔

2020-11-07

同学好,日志输出在这里 [C:\Users\user\AppData\Local\JetBrains\IntelliJIdea2020.2\tomcat\Unnamed_o2o/logs/webapps/error.log 看看

0
2
翔仔
回复
warren_au
那应该就剩下配置的问题了,直接复制粘贴https://git.imooc.com/coding-144/coding-144/src/master/mvco2o/src/main/resources/logback.xml 没问题后,对比下异同
2020-11-10
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程