打印LoggerFactory来源

<%@ page import="org.slf4j.LoggerFactory, org.slf4j.impl.StaticLoggerBinder" %>
<%
// 打印LoggerFactory来源
java.net.URL url = LoggerFactory.class.getResource("LoggerFactory.class");
out.println("LoggerFactory jar source:"+url+"<br/>");
out.println("LoggerFactory ClassLoader:"+LoggerFactory.class.getClassLoader()+"<br/>");

// 打印Binder来源
java.net.URL binderUrl = StaticLoggerBinder.class.getResource("StaticLoggerBinder.class");
out.println("StaticLoggerBinder jar source:"+binderUrl+"<br/>");
out.println("StaticLoggerBinder ClassLoader:"+StaticLoggerBinder.class.getClassLoader()+"<br/>");
%>

----------------------------------------------------------------------------------------------------------------------------------------

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
......
// 打印LoggerFactory来源
java.net.URL url = LoggerFactory.class.getResource("LoggerFactory.class");
System.out.println("LoggerFactory jar source:"+url);
System.out.println("LoggerFactory ClassLoader:"+LoggerFactory.class.getClassLoader());
......
}

posted @ 2026-11-21 01:01  尐鱼儿  阅读(5)  评论(0)    收藏  举报