open source address
/lboot/LLog
synopsis
LLog
is based onAOP
The 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 anyLucy
series of dependencies needs to be completed before thejitpack
Configuration of the mirror repository.
<repositories>
<repository>
<id></id>
<url></url>
</repository>
</repositories>
integrated (as in integrated circuit)
pull into
existpom
is introduced in therelease versionConsistent.
<dependency>
<groupId></groupId>
<artifactId>LLog</artifactId>
<version>0.0.8</version>
</dependency>
configure
1. Whitelisting configuration
LLog
Log management page access is only supported by default127.0.0.1
request source access (i.e., support for local access), if you need to support more access sources, you need to configure the releaseIP
list, by means of the,
Separation.
# Log request whitelist
=127.0.0.1,198.0.0.1
2. Database configuration
LLog
on the basis oflucy-jpa
Building 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
LLog
If you need to obtain the user ID, you need to complete the configuration of the authentication service, expand the implementation of theAuthService
hit the nail on the headisLogin
cap (a poem)getUid
interface, or by directly introducing thelucy-rbac
and 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(){
//
}
@ApiLog
The 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 method
Combination 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] Updated
lucy-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@