mrsarm / log4jwebtracker Goto Github PK
View Code? Open in Web Editor NEWJava web tool to setup at runtime the log level of Log4j appenders in an application, and read the log at runtime.
Java web tool to setup at runtime the log level of Log4j appenders in an application, and read the log at runtime.
At first I noticed the Log view does not show all of my appenders I configured. Later I realize its a compatibility issue with Log4J 2.x.
Can this project been extended to support Log4J 2.x please?
PS: Please see if this is helpful http://stackoverflow.com/questions/32864929/log4j-getallappenders-returns-null-enumeration
TrackerServlet#getJQueryMin(), TrackerServlet#getJQueryWordWrap(), TrackerServlet#getCSS() and TrackerServlet#getLogo() read only the number of bytes returned from InputStream#available() .
Unfortunately, InputStream#available() does not necessarily return the number of bytes of the entire resource, it may return a smaller number (as seen on Weblogic 9.2MP3).
When the TrackerServlet is mapped to a URL Pattern containing the string '/log', such as /log4j/*, it causes problems with some of the servlet code. For example, the /config page produces a NullPointerException:
java.lang.NullPointerException
at log4jwebtracker.servlet.TrackerServlet.doHTML(TrackerServlet.java:364)
at log4jwebtracker.servlet.TrackerServlet.doConfiguration(TrackerServlet.java:157)
at log4jwebtracker.servlet.TrackerServlet.doPage(TrackerServlet.java:114)
at log4jwebtracker.servlet.TrackerServlet.service(TrackerServlet.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
The problem is that the "action" variable is set using request.getRequestURI(), which contains the url pattern for the servlet. So you can see that line 357 of TrackerServlet, which would normally evaluate to false for a /config request, evaluates to true if the url pattern contains '/log'.
if (request.getAttribute("action").toString().indexOf("/log") != -1) {
This causes problems, as it's not supposed to be doing the /log stuff when it's in /config mode! In particular, the above NullPointerException occurs because there is no fileAppenders request attirbute in Config mode.
This could be fixed simply in the documentation -- specifying which substrings are not acceptable in serlvet-mapping url-pattern (/log, /config, etc.). Or the code could be fixed also at some point.
(thanks for a great tool!!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.