Light Logging Configurer

Pluggable Java web library for runtime logging level configuration

License

License

Categories

Categories

config Application Layer Libs Configuration Logging
GroupId

GroupId

org.lightadmin
ArtifactId

ArtifactId

light-logging-configurer
Last Version

Last Version

1.0.0.RC1
Release Date

Release Date

Type

Type

jar
Description

Description

Light Logging Configurer
Pluggable Java web library for runtime logging level configuration
Project URL

Project URL

http://lightadmin.org
Project Organization

Project Organization

LA Team
Source Code Management

Source Code Management

http://github.com/la-team/light-logging-configurer

Download light-logging-configurer

How to add to project

<!-- https://jarcasting.com/artifacts/org.lightadmin/light-logging-configurer/ -->
<dependency>
    <groupId>org.lightadmin</groupId>
    <artifactId>light-logging-configurer</artifactId>
    <version>1.0.0.RC1</version>
</dependency>
// https://jarcasting.com/artifacts/org.lightadmin/light-logging-configurer/
implementation 'org.lightadmin:light-logging-configurer:1.0.0.RC1'
// https://jarcasting.com/artifacts/org.lightadmin/light-logging-configurer/
implementation ("org.lightadmin:light-logging-configurer:1.0.0.RC1")
'org.lightadmin:light-logging-configurer:jar:1.0.0.RC1'
<dependency org="org.lightadmin" name="light-logging-configurer" rev="1.0.0.RC1">
  <artifact name="light-logging-configurer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.lightadmin', module='light-logging-configurer', version='1.0.0.RC1')
)
libraryDependencies += "org.lightadmin" % "light-logging-configurer" % "1.0.0.RC1"
[org.lightadmin/light-logging-configurer "1.0.0.RC1"]

Dependencies

compile (20)

Group / Artifact Type Version
org.springframework.boot : spring-boot Optional jar 1.1.6.RELEASE
org.springframework : spring-websocket jar 4.1.0.RELEASE
org.springframework : spring-messaging jar 4.1.0.RELEASE
javax.inject : javax.inject jar 1
com.fasterxml.jackson.core : jackson-core jar 2.3.4
com.fasterxml.jackson.core : jackson-databind jar 2.3.4
com.fasterxml.jackson.core : jackson-annotations jar 2.3.4
com.google.guava : guava jar 18.0
org.slf4j : jcl-over-slf4j jar 1.7.7
org.slf4j : jul-to-slf4j jar 1.7.7
org.slf4j : log4j-over-slf4j jar 1.7.7
org.slf4j : slf4j-api jar 1.7.7
ch.qos.logback : logback-classic jar 1.1.2
org.springframework : spring-web jar 4.1.0.RELEASE
org.springframework : spring-webmvc jar 4.1.0.RELEASE
org.springframework : spring-core jar 4.1.0.RELEASE
org.thymeleaf : thymeleaf jar 2.1.3.RELEASE
org.thymeleaf : thymeleaf-spring4 jar 2.1.3.RELEASE
org.springframework : spring-context jar 4.1.0.RELEASE
org.springframework : spring-context-support jar 4.1.0.RELEASE

provided (1)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.1.0

Project Modules

There are no modules declared in this project.

Pluggable Java web library for runtime logging level configuration

The goal of the project is to provide a logger configuration UI for changing logging levels directly from web interface.

License

Light Logging Configurer is released under version 2.0 of the Apache License.

Integration examples

Documentation & Support

Getting started

Light Logging Configurer is designed in such a way that it should integrate with your existing Java web applications with very little effort.

To install Light Logging Configurer alongside your application, simply add the required dependency, enable its WebApplicationInitializer using servlet context init parameters or register our ServletContextInitializer implementation if you're running Spring Boot app. The last step would be to adjust your logback configuration with "websocket-aware" appender.

Adding Light Logging Configurer to a Maven project

To add Light Logging Configurer to a Maven-based project, add the light-logging-configurer artifact to your compile-time dependencies:

<dependency>
  <groupId>org.lightadmin</groupId>
  <artifactId>light-logging-configurer</artifactId>
  <version>1.0.0.RC1</version>
</dependency>

Configuring Light Logging Configurer web module in Servlet 3.0 environment

To install Light Logging Configurer alongside your existing web application, you need to include the appropriate configuration to your WebApplicationInitializer.

@Override
public void onStartup(ServletContext servletContext) throws ServletException {
  servletContext.setInitParameter(LIGHT_CONFIGURER_BASE_URL, "/logger");
  servletContext.setInitParameter(LIGHT_CONFIGURER_BACK_TO_SITE_URL, "http://lightadmin.org");
}

The equivalent of the above in a standard web.xml will also work identically to this configuration.

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0" metadata-complete="false">
         
  <context-param>
    <param-name>light:configurer:base-url</param-name>
    <param-value>/logger</param-value>
  </context-param>

  <context-param>
    <param-name>light:configurer:back-to-site-url</param-name>
    <param-value>http://lightadmin.org</param-value>
  </context-param>

</web-app>

Configuring Light Logging Configurer web module for Spring Boot application

To install Light Logging Configurer alongside your existing Spring Boot web application, you need to register ServletContextInitializer.

@Configuration
@EnableAutoConfiguration(exclude = {ThymeleafAutoConfiguration.class, SecurityAutoConfiguration.class})
public class Application extends SpringBootServletInitializer {
  
  public static void main(String[] args) throws Exception {
    SpringApplication.run(LightAdminBootApplication.class, args);
  }

  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(LightAdminBootApplication.class);
  }
    
  @Bean
  public ServletContextInitializer lightConfigurerServletContextInitializer() {
      return new LightConfigurerServletContextInitializer("/logger");
  }
}

Configuring Light Logging Configurer Logback appender

<configuration>
  <appender name="MessageSendingAppender" class="org.lightadmin.logging.configurer.logback.MessageSendingAppender"/>
  
  <logger name="org.lightadmin" level="INFO"/>
  
  <root level="INFO">
    <appender-ref ref="MessageSendingAppender"/>
  </root>
</configuration>

Screenshots

Main Screen

org.lightadmin

la-team

Smart software development team

Versions

Version
1.0.0.RC1