All Projects → mrsarm → Log4jwebtracker

mrsarm / Log4jwebtracker

Java web tool to setup at runtime the log level of Log4j appenders in an application, and read the log at runtime.

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Log4jwebtracker

Trail
Trail is a simple logging system for Java and Android. Create logs using the same API and the library will detect automatically in which platform the code is running.
Stars: ✭ 13 (-62.86%)
Mutual labels:  logging
Logging
Easy setup of clojure.tools.logging w/ SLF4j, plus request correlation
Stars: ✭ 21 (-40%)
Mutual labels:  logging
Testlogcollectors
A framework for capturing log statements during tests. Compatible with most popular logging frameworks. Works with JUnit and TestNG
Stars: ✭ 31 (-11.43%)
Mutual labels:  logging
Loggingprint
Swift logging only when in Debug mode.
Stars: ✭ 14 (-60%)
Mutual labels:  logging
Cartus
A structured logging abstraction with multiple backends.
Stars: ✭ 21 (-40%)
Mutual labels:  logging
Nim Morelogging
Logging library for Nim
Stars: ✭ 29 (-17.14%)
Mutual labels:  logging
Fluentd
Log shipping mechanism for Deis Workflow
Stars: ✭ 10 (-71.43%)
Mutual labels:  logging
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-5.71%)
Mutual labels:  logging
Rsyslog
An R interface to syslog, the POSIX system logger API
Stars: ✭ 21 (-40%)
Mutual labels:  logging
Escriba
📜 Logging on steroids
Stars: ✭ 30 (-14.29%)
Mutual labels:  logging
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+2422.86%)
Mutual labels:  logging
Belogging
Easy and opinionated logging configuration for Python apps
Stars: ✭ 20 (-42.86%)
Mutual labels:  logging
Lme
An npm package to simply and beautifully log to console.
Stars: ✭ 29 (-17.14%)
Mutual labels:  logging
Eliot
Eliot: the logging system that tells you *why* it happened
Stars: ✭ 874 (+2397.14%)
Mutual labels:  logging
Nlog.xlogger
A C# .NET class library that extends NLog.Logger to provide additional functionality for tracing the entry and exit, arbitrary checkpoints, exceptions and stack traces within methods.
Stars: ✭ 31 (-11.43%)
Mutual labels:  logging
Logger Telegram Backend
A logger backend for Telegram
Stars: ✭ 13 (-62.86%)
Mutual labels:  logging
Adenium
Adenium Normalizer
Stars: ✭ 29 (-17.14%)
Mutual labels:  logging
Logzero
Robust and effective logging for Python 2 and 3.
Stars: ✭ 977 (+2691.43%)
Mutual labels:  logging
Lumberjack
A terminal-ui log watcher written in Go using the Flux architecture
Stars: ✭ 31 (-11.43%)
Mutual labels:  logging
Dotlog
Simple and easy go log framework
Stars: ✭ 30 (-14.29%)
Mutual labels:  logging

Log4j Web Tracker

Log4j Web Tracker is an open source web tool to setup at runtime the Apache Log4j configuration loggers of an application. It also has a tab that allows read the logs at runtime, or download them.

It's distributed in a small .jar file (log4jwebtracker.jar), and it must be placed in the WEB-INF/lib folder of the java web application.

To configure it, in the WEB-INF/web.xml file you have to add a mapping like this:

    <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>

In the example the tool was mapped as /tracker/*, so if the application is accessible in http://localhost:8080/myapp, the right URL to access the tracker is:

http://localhost:8080/myapp/tracker

Introduction

In the first tab you can setup the level of each logger of the application, including the root logger. The configuration are applied at the moment, but not change the original configuration placed in log4j.properties, log4j.xml or any configuration file, if you restart the application, the original configuration will applied again.

In the second tab named Log, you can select an appender file and view the last content in the webpage (the numbers of line are configurable), or download them.

Log4j configuration

Log4j not need any special configuration for use this tool, you can use the usual way to configure the logging. Many developers used a util class from Spring in the web context to do this (org.springframework.web.util.Log4jConfigListener).

Also you can use the automatic setup (the configuration file must be placed on the WEB-INF/classes folder), or the manually basic setup, invoking org.apache.log4j.PropertyConfigurator.configure(String configFilename).

Log4jWebTracker provides a servlet class to do that, but it's optional:

    <servlet>
            <servlet-name>Log4jInitServlet</servlet-name>
            <servlet-class>log4jwebtracker.servlet.init.Log4jInitServlet</servlet-class>
            <init-param>
                    <param-name>log4jConfigLocation</param-name>
                    <param-value>WEB-INF/classes/log4j.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
    </servlet>

Requirements

  • Java 1.4+
  • Servlet container 2.3+ (like Apache Tomcat 4.1 or higher, or WebSphere 5.0+, etc.)

Dependencies

No dependencies with others libraries or frameworks, except of course Log4j (tested only with v1.2).

Maven projects

If your project is building using Apache Maven 2 or above, put this artifact in your pom.xml to import the jar:

    <dependency>
        <groupId>log4jwebtracker</groupId>
        <artifactId>log4jwebtracker</artifactId>
        <version>1.0.2</version>
    </dependency>

The repository necessary to get the artifact is:

    <repository>
            <id>log4jwebtracker-releases</id>
            <url>http://repo.log4jwebtracker.com/maven2</url>
    </repository>

TO DO

  • Securize access (anyway, can be done with filters, web security using web.xml policies, or others options).
  • Configure appenders and patterns at runtime.
  • Filter field with regular expressions to match the output of the log.
  • Send us your proposal...

License

The project is licensed under the terms of the GNU Lesser GPL General Public License version 3 (LGPLv3).

Binary and Source Code

This source code is available in Github.

Also the source is available in .jar format here.

The binary version in .jar format, ready to use for your project is here.

About

Author: My name is Mariano Ruiz, I work as Software & Web Developer. I'm from Argentina.

My Home: http://www.mrdev.com.ar | Email: [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].