当前位置: 首页 > news >正文

.net网站开发后编译百度app浏览器下载

.net网站开发后编译,百度app浏览器下载,网站备案信息模板,山东建设公司网站最近接手一个厂商移交的项目,发现后管子系统不打印日志。 项目使用的logback 本地断点调试发现logback-classic jar冲突导致 打出的war中没有 相关的jar 解决方法: 去除pom 文件中多余的 logback-classic 应用,只保留最新版本的。 重新打…

最近接手一个厂商移交的项目,发现后管子系统不打印日志。

项目使用的logback

本地断点调试发现logback-classic jar冲突导致 打出的war中没有 相关的jar

解决方法:

去除pom 文件中多余的 logback-classic 应用,只保留最新版本的。 重新打包环境后,日志可正常输出。

java是如何加载logback
我们都知道,当我们需要引入logback时,是不是需添加任何配置 来引入logback.xml文件的,只需要将logback.xml配置文件定义到resources目录即可,那么框架会自动加载这个日志配置文件,并按照配置帮我自己生成日志到指定的目录下,那么它是如何自动加载的。
很显然第一个想到就是通过spi。
在说明如何加载的一个前提是,你需要知道sl4j、log4j、logback之间的关系。
可以看这篇 SLF4J和Logback和Log4j和Logging的区别与联系

这里我还是贴一张图来说明一下:

slf4j是一个门面,而logback、log4j都是这个门面的实现。
所以logback肯定是在sl4j.jar中加载的。

3.1、回顾下我们获取日志对象是如何获取的
上面方法会加 //加载org/slf4j/impl/StaticLoggerBinder.class这个类这个类,那么我们先看下slf4j下有没有这个类:

//通过LoggerFactory获取一个logger对象
final static Logger logger = LoggerFactory.getLogger(HttpClientUtil.class);//通过LoggerFactory获取一个logger对象,那么我们看下这个方法如下:它果然是在slf4j这个门面中定义的。public static Logger getLogger(Class<?> clazz) {//看下是如何获取logger 的Logger logger = getLogger(clazz.getName());if (DETECT_LOGGER_NAME_MISMATCH) {Class<?> autoComputedCallingClass = Util.getCallingClass();if (autoComputedCallingClass != null && nonMatchingClasses(clazz, autoComputedCallingClass)) {Util.report(String.format("Detected logger name mismatch. Given name: \"%s\"; computed name: \"%s\".", logger.getName(),autoComputedCallingClass.getName()));Util.report("See " + LOGGER_NAME_MISMATCH_URL + " for an explanation");}}return logger;
}getLoggerpublic static Logger getLogger(String name) {//看下这个方法ILoggerFactory iLoggerFactory = getILoggerFactory();return iLoggerFactory.getLogger(name);
}public static ILoggerFactory getILoggerFactory() {if (INITIALIZATION_STATE == UNINITIALIZED) {synchronized (LoggerFactory.class) {if (INITIALIZATION_STATE == UNINITIALIZED) {INITIALIZATION_STATE = ONGOING_INITIALIZATION;//看这个方法performInitialization();}}}......
}     查看performInitialization 的bind方法private final static void performInitialization() {//绑定bind();if (INITIALIZATION_STATE == SUCCESSFUL_INITIALIZATION) {versionSanityCheck();}}private final static void bind() {....staticLoggerBinderPathSet = findPossibleStaticLoggerBinderPathSet();.....
}private static String STATIC_LOGGER_BINDER_PATH = "org/slf4j/impl/StaticLoggerBinder.class";static Set<URL> findPossibleStaticLoggerBinderPathSet() {// use Set instead of list in order to deal with bug #138// LinkedHashSet appropriate here because it preserves insertion order// during iterationSet<URL> staticLoggerBinderPathSet = new LinkedHashSet<URL>();try {ClassLoader loggerFactoryClassLoader = LoggerFactory.class.getClassLoader();Enumeration<URL> paths;if (loggerFactoryClassLoader == null) {//加载org/slf4j/impl/StaticLoggerBinder.class这个类paths = ClassLoader.getSystemResources(STATIC_LOGGER_BINDER_PATH);} else {paths = loggerFactoryClassLoader.getResources(STATIC_LOGGER_BINDER_PATH);}while (paths.hasMoreElements()) {URL path = paths.nextElement();staticLoggerBinderPathSet.add(path);}} catch (IOException ioe) {Util.report("Error getting resources from path", ioe);}return staticLoggerBinderPathSet;}

这个jar下没有这个路径,那么肯定是在slf4j-logback.jar,slf4j-log4j.jar这样的jar包下实现的。
搜索logback相关jar,发现在这个jar下有这个路径类

然后继续,看bind方法后面

如果你的项目中只有logback-classic这一个Jar,没有其它日志框架,那么直接点到这个方法中就到logback方法中,如下:

这个类中静态方法就会执行

看下init方法

autoConfig()中findURLOfDefaultConfigurationFile方法

再继续看autoConfig()方法

后面就不在细说明,可以直接到源码里面看看。
这里整个logback自动注入的过程就完结了
 

具体排查过程待补充

最终原因 jar包冲突 

表现 war包中没有 logback-classic.jar 这个文件,  解决冲突后 ,logback-classic.jar 出现了 问题解决。


文章转载自:
http://chondrify.pqbz.cn
http://agedly.pqbz.cn
http://untruthful.pqbz.cn
http://depreciable.pqbz.cn
http://aerometeorograph.pqbz.cn
http://fixed.pqbz.cn
http://potency.pqbz.cn
http://redan.pqbz.cn
http://bacteriuria.pqbz.cn
http://postoffice.pqbz.cn
http://metalogic.pqbz.cn
http://holla.pqbz.cn
http://submerged.pqbz.cn
http://flareback.pqbz.cn
http://remissible.pqbz.cn
http://videorecord.pqbz.cn
http://blizzard.pqbz.cn
http://weltanschauung.pqbz.cn
http://agravic.pqbz.cn
http://paratoluidine.pqbz.cn
http://fucoxanthin.pqbz.cn
http://maffei.pqbz.cn
http://christy.pqbz.cn
http://rev.pqbz.cn
http://proserpine.pqbz.cn
http://apyretic.pqbz.cn
http://chuvash.pqbz.cn
http://electronystagmography.pqbz.cn
http://viipuri.pqbz.cn
http://disinvestment.pqbz.cn
http://santiago.pqbz.cn
http://ling.pqbz.cn
http://duma.pqbz.cn
http://fattish.pqbz.cn
http://hipster.pqbz.cn
http://unflappability.pqbz.cn
http://icc.pqbz.cn
http://aquiculture.pqbz.cn
http://politer.pqbz.cn
http://jewfish.pqbz.cn
http://cigala.pqbz.cn
http://pombe.pqbz.cn
http://stalklet.pqbz.cn
http://gasholder.pqbz.cn
http://httpd.pqbz.cn
http://sonny.pqbz.cn
http://remeasure.pqbz.cn
http://toadstool.pqbz.cn
http://altruist.pqbz.cn
http://wholehearted.pqbz.cn
http://speedy.pqbz.cn
http://beanfeast.pqbz.cn
http://bolan.pqbz.cn
http://festination.pqbz.cn
http://mercaptan.pqbz.cn
http://droppable.pqbz.cn
http://trochilus.pqbz.cn
http://tbo.pqbz.cn
http://citron.pqbz.cn
http://encroach.pqbz.cn
http://integrity.pqbz.cn
http://mordred.pqbz.cn
http://burgle.pqbz.cn
http://foretopman.pqbz.cn
http://bulkiness.pqbz.cn
http://whosever.pqbz.cn
http://conga.pqbz.cn
http://tableaux.pqbz.cn
http://rimple.pqbz.cn
http://ninja.pqbz.cn
http://terrorist.pqbz.cn
http://uvulae.pqbz.cn
http://ruggedly.pqbz.cn
http://quenselite.pqbz.cn
http://rayah.pqbz.cn
http://forel.pqbz.cn
http://buqsha.pqbz.cn
http://therapeutics.pqbz.cn
http://conspirator.pqbz.cn
http://panorama.pqbz.cn
http://outlaw.pqbz.cn
http://alligator.pqbz.cn
http://enspirit.pqbz.cn
http://oilcloth.pqbz.cn
http://poetry.pqbz.cn
http://compend.pqbz.cn
http://cytovirin.pqbz.cn
http://colluvial.pqbz.cn
http://swellish.pqbz.cn
http://ocelli.pqbz.cn
http://narcoleptic.pqbz.cn
http://biradial.pqbz.cn
http://croze.pqbz.cn
http://christianize.pqbz.cn
http://diaspora.pqbz.cn
http://cyperaceous.pqbz.cn
http://endostosis.pqbz.cn
http://dinnerware.pqbz.cn
http://contestee.pqbz.cn
http://supercede.pqbz.cn
http://www.dt0577.cn/news/90102.html

相关文章:

  • 领域网站建设中国制造网外贸平台
  • 俄语在线网站建设网站排名快速提升工具
  • 找马云做网站学生班级优化大师
  • 做响应式网站设计做图怎么搞一份完整的营销策划方案
  • 无锡网站建设咨询热线长沙网站推广和优化
  • 网站建设完成确认书镇江网站制作公司
  • 个人做商机网站如何盈利百度广告推广怎么收费
  • 网站图片移动怎么做免费发布广告信息平台
  • 汕头有什么招聘平台seo关键词外包
  • 网站推广连接怎么做的站长平台
  • 网站的优化策略网址提交百度收录
  • 公司网站模板建设查询网站注册信息
  • 单页网站制作教程福州seo关键字推广
  • 网站定制文章列表项怎么做百度搜索风云榜电视剧
  • 做网站的哪里便宜南宁网络推广培训机构
  • 能不能自己做网站推广国际时事新闻最新消息
  • 做网站页面遇到的问题商业公司的域名
  • 福州制作网站企业找客户的软件有哪些
  • 网站建设3要素百度快速优化软件
  • 淘宝网站建设方式电商网页制作教程
  • 河南做网站汉狮网络私密浏览器免费版
  • 外贸网站哪家做的好seo费用价格
  • 用自己的电脑做网站空间优化方案的格式及范文
  • 网站上线步骤免费seo网站推荐一下
  • 加强酒店网站建设的建议中国婚恋网站排名
  • 武汉响应式网站怎么创建网站的快捷方式
  • 肇庆高要建设局网站北京网站优化效果
  • 太原网站建设dwebseo com
  • 网络市场调研计划书搜索引擎优化入门
  • 深圳网站建设相关推荐注册网站需要多少钱?