debug信息显示的是查询数据库时候的语句以及传入的值,但是突然不能进行debug输出了,输出的都是info (log4j使用简单的配置文件在最后)
截一小部分debug输出的图:
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Returning cached instance of singleton bean 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#2'
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Returning cached instance of singleton bean 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#3'
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Found resource handler mapping: URL pattern="/js/**", locations=[ServletContext resource [/js/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@516bebd1]
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Found resource handler mapping: URL pattern="/html/**", locations=[ServletContext resource [/html/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@2cb7c408]
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Found resource handler mapping: URL pattern="/css/**", locations=[ServletContext resource [/css/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@1cdfdd66]
2018-12-06 11:52:50 -5189 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Found resource handler mapping: URL pattern="/fonts/**", locations=[ServletContext resource [/fonts/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@2d20fe1]
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain]
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found - trying original name [spring.liveBeansView.mbeanDomain]. javax.naming.NameNotFoundException: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].. Returning null.
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source
2018-12-06 11:52:50 -5190 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Published WebApplicationContext of servlet 'springmvc' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.springmvc]
2018-12-06 11:52:50 -5191 [RMI TCP Connection(2)-127.0.0.1] INFO - FrameworkServlet 'springmvc': initialization completed in 2266 ms
2018-12-06 11:52:50 -5191 [RMI TCP Connection(2)-127.0.0.1] DEBUG - Servlet 'springmvc' configured successfully
变成了如下的info打印
11:57:46.812 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'springmvc-servlet': startup date [Thu Dec 06 11:57:45 CST 2018]; parent: Root WebApplicationContext
11:57:47.012 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'springmvc-servlet': startup date [Thu Dec 06 11:57:45 CST 2018]; parent: Root WebApplicationContext
11:57:47.179 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Detected @ExceptionHandler methods in exceptionHandlers
11:57:47.287 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/js/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
11:57:47.332 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/html/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1'
11:57:47.375 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/css/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#2'
11:57:47.418 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.w.s.h.SimpleUrlHandlerMapping - Mapped URL path [/fonts/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#3'
11:57:47.554 [RMI TCP Connection(2)-127.0.0.1] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'springmvc': initialization completed in 2033 ms
配置文件是
log4j.rootLogger=DEBUG,CONSOLE
log4j.addivity.org.apache=false
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG #输出debug
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} -%-4r [%t] %-5p %x - %m%n
log4j.appender.CONSOLE.Target=System.out
#log4j.appender.CONSOLE.charset=utf-8
log4j.appender.CONSOLE.encoding=utf-8
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
org.apache.catalina.core.ContainerBase.[Catalina].level=info
org.apache.catalina.core.ContainerBase.[Catalina].handlers=java.util.logging.ConsoleHandler
原因是使用tesseract 的ocr识别的包 ,导入进pom 所以出现debug,不出现,只出现info,将这些包进行清除就好了.测试完其他的之后在打开使用
如果出现这个原因可以试试是不是包的问题.