log4j monitor tool Log4j Web Tracker

It is good tool , git is HERE.

Steps are

    1. add dependency in Maven or build yourself and add to library.
           <dependency>
              <groupId>log4jwebtracker</groupId>
              <artifactId>log4jwebtracker</artifactId>
              <version>1.0.1</version>
          </dependency>
      
    2. add servlet mapping in web.xml
          <servlet>
              <servlet-name>TrackerServlet</servlet-name>
              <servlet-class>log4jwebtracker.servlet.TrackerServlet</servlet-class>
          </servlet>
          <servlet-mapping>
              <servlet-name>TrackerServlet</servlet-name>
              <url-pattern>/tracker/*</url-pattern>
          </servlet-mapping>
      
    3. In the example the tool was mapped as /tracker/*, so if the application is accessible in http://localhost:8080/myapp, the correct URL to access to the tracker is:

      http://localhost:8080/myapp/tracker

 

Just remember to add the appender you need to display in the web UI under the root element in the log4j xml config file.

Root is a special logger.

By specifying a log level in root element, it will contain all the log info in the current app.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s