Location>code7788 >text

LLog: Spring lightweight log monitoring component , integrated management panel , support for multi-criteria query search

Popularity:370 ℃/2024-09-10 09:22:50

open source address

/lboot/LLog

synopsis

LLogis based onAOPThe request logging and querying tool library is constructed, and the configuration is completed by introducing the tool library to realize the functions of logging and querying and retrieving the request logs of the interface.

intend

Before introducing anyLucyseries of dependencies needs to be completed before thejitpackConfiguration of the mirror repository.

<repositories>
        <repository>
            <id></id>
            <url></url>
        </repository>
</repositories>

integrated (as in integrated circuit)

pull into

existpomis introduced in therelease versionConsistent.

<dependency>
        <groupId></groupId>
        <artifactId>LLog</artifactId>
        <version>0.0.8</version>
</dependency>

configure

1. Whitelisting configuration

LLogLog management page access is only supported by default127.0.0.1request source access (i.e., support for local access), if you need to support more access sources, you need to configure the releaseIPlist, by means of the,Separation.

# Log request whitelist
=127.0.0.1,198.0.0.1

2. Database configuration

LLogon the basis oflucy-jpaBuilding database access requires completing the corresponding database configuration.

# MySQL
-class-name=
=jdbc:mysql://127.0.0.1:3306/demo?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
=demo
=
# JPA Allow structure substitution
-bean-definition-overriding=true
# Minimum number of idle connections
-idle=5
# Maximum lifetime
-lifetime=120000
# Maximum idle connection lifetime, default 600000 (10 minutes)
-timeout=50000
# Maximum number of connections in the connection pool, default is 10
-pool-size=20
# This attribute controls the default auto-commit behavior for connections returned from the pool, default: true
-commit=true
# Connection test query
-test-query=SELECT 1
# jpa configuration
-auto=update
-sql=false
=MYSQL
# automatically convert camel naming to lowercase and underscore userId -> user_id
-strategy=
#Without this it defaults to the myisam engine
-platform= .MySQL5InnoDBDialect

3. Configuration of the authentication program

LLogIf you need to obtain the user ID, you need to complete the configuration of the authentication service, expand the implementation of theAuthServicehit the nail on the headisLogincap (a poem)getUidinterface, or by directly introducing thelucy-rbacand other realization schemes.

Recommended custom implementations

@Slf4j
@Service
@AllArgsConstructor
public class DemoAuthServiceImpl implements AuthService {
    @Override
    public Boolean isLogin() {
        // return (); // utilization SaToken
        return ();
    }

    @Override
    public String getUid() {
        // return (); // utilization SaToken
        return null;
    }
}

utilization

@ApiLog

Automatic logging of interface requests is achieved by marking interfaces that require request logging with custom annotations.

@ApiLog("tracking test")
@GetMapping("trace")
@ApiOperation(value = "follow a trailIDbeta (software)")
public ResponseDTO<Object> testTrace(){
    //
}

@ApiLogThe annotations are configurable as follows.

parameters typology note
value string Defaults to the module term to which the request belongs
module string value Alias
ignoreResponse int Record data whether to ignore the response result, 1 is yes, 0 is no
ignoreRequest int Record whether the data ignores the request parameters, 1 is yes, 0 is no

administration panel

Go to the Log View Management page by visiting the project deployment address.

http://localhost:8080/

Supports log retrieval methods for multiple conditions.

Function Screenshot

1. Exception stack

2. Request & response data

Hover to view

3. Conditional queries

Conditional Combination Query

For example, here isstate of affairs+interface methodCombination query that supports combinations of all conditions.

keyword matching search

Both request sources and request parameters support fuzzy query matching, theSupport conditional query and fuzzy query combination

Update Log

0.0.8

  • [Feature] Updatedlucy-spring-boot-starter version dependency
  • [New] Fuzzy matching by request parameter is now supported.
  • [Fixed] Fixed the bug that reset page numbers don't change

More...

Technical Support

kindear@