Skip to content

jartool/console-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

console-spring-boot

一、简介


基于websocket和驱逐队列写的一个小工具,可以浏览器实时查看控制台日志。

二、食用方式

  • maven


<!-- console-spring-boot -->
<dependency>
    <groupId>io.github.jartool</groupId>
    <artifactId>console-spring-boot</artifactId>
    <version>1.0.2</version>
</dependency>
<!-- thymeleaf -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- websocket -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
  • logback-spring.xml


ConsoleAppender Add: <filter class="io.github.jartool.console.filter.LogFilter"></filter>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>INFO</level>
    </filter>
    <filter class="io.github.jartool.console.filter.LogFilter"></filter>
    <encoder>
        <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
        <charset>UTF-8</charset>
    </encoder>
</appender>
  • configuration


//启动类Add: @EnableConsole注解即可
@EnableConsole
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}
#yml配置
jartool:
  console:
    view: /console  #控制台日志访问地址,默认: /console
    queue:
      size: 1000  #日志队列容量,默认: 1000
    auth:
      enable: true  #是否开启页面授权,默认: true
      url: /consoleAuth  #授权校验接口url,默认: /consoleAuth
      key: auth  #授权key,默认: auth
      username: admin  #用户名,默认: admin
      password: admin  #密码,默认: admin

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published