Git Product home page Git Product logo

springboot-online-log's Introduction

Introduction

Allens online log is a lightweight springboot online log viewing component, you can use it to view logs in a test production environment. Provides simple authentication and log viewing functions. Hope you like it.

How to install this component ?

  1. Pom file import this dependency.
<dependency>
    <groupId>io.github.yh4494</groupId>
    <artifactId>allens-online-log</artifactId>
    <version>1.0.1</version>
</dependency>
  1. Add the annotation @AllensOnlineLog to the main class or other configuration class.
@AllensOnlineLog
@Slf4j
public class ApplicationStarter {
}
  1. Ignore authentication routing

① If you use the SpringSecurity component, you can add the following configuration to the security configuration class.

http.authorizeRequests().and().csrf().disable()
        .antMatchers("/log/**")
        .anonymous();

② If you use the default springboot interceptor, you can add the following configuration to the interceptor configuration class.

@Configuration
public class MyInterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor())
                .excludePathPatterns("/log/**"); // 忽略指定路由
    }
}

③ If you use the other security component, you can ignore the routing /log/**. that's all.

  1. Configure the log path in the application.properties file.
logging:
  log-home: /var/logs/efficient-notes
  online:
    username: admin                                    # default username: admin
    password: admin                                    # default password: admin
    title: 'Efficient Notes Logs'                      # default title: Efficient Notes Logs
    log-file: ${logging.log-home}/efficient-note.log   # your log file path
  config: classpath:logback-spring.xml
  1. Visit the log page
http://localhost:${your application port}/log/

image

After entering the correct username and password, you can view the log information.

image

operation log image

springboot-online-log's People

Contributors

yh4494 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.