[NO-ISSUE] Add applicationName property
This commit is contained in:
parent
b9bf4386ae
commit
beb6c619e5
|
@ -23,12 +23,14 @@ public class LoggingInterceptor implements HandlerInterceptor {
|
|||
private final LogPersistenceService logPersistenceService;
|
||||
private final LoggingProperties.HttpMethod httpMethodProperties;
|
||||
private final LoggingProperties.HttpStatus httpStatusProperties;
|
||||
private final String applicationName;
|
||||
|
||||
public LoggingInterceptor(LogPersistenceService logPersistenceService,
|
||||
LoggingProperties loggingProperties) {
|
||||
this.logPersistenceService = logPersistenceService;
|
||||
this.httpMethodProperties = loggingProperties.getHttpMethod();
|
||||
this.httpStatusProperties = loggingProperties.getHttpStatus();
|
||||
this.applicationName = loggingProperties.getApplicationName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +44,7 @@ public class LoggingInterceptor implements HandlerInterceptor {
|
|||
.body(getBodyIfAvailable(request))
|
||||
.requestedAt(Instant.now())
|
||||
.traceId(MDC.get("traceId"))
|
||||
.applicationName("myoa-engineering-logging-sample")
|
||||
.applicationName(applicationName)
|
||||
.build();
|
||||
loggingRequest(requestLog);
|
||||
logPersistenceService.save(requestLog);
|
||||
|
@ -91,7 +93,7 @@ public class LoggingInterceptor implements HandlerInterceptor {
|
|||
.body(getBodyIfAvailable(response))
|
||||
.respondedAt(Instant.now())
|
||||
.traceId(MDC.get("traceId"))
|
||||
.applicationName("myoa-engineering-logging-sample")
|
||||
.applicationName(applicationName)
|
||||
.build();
|
||||
loggingResponse(responseLog);
|
||||
logPersistenceService.save(responseLog);
|
||||
|
|
|
@ -14,6 +14,7 @@ public class LoggingProperties {
|
|||
|
||||
private HttpMethod httpMethod;
|
||||
private HttpStatus httpStatus;
|
||||
private String applicationName;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
|
@ -21,6 +21,7 @@ logging:
|
|||
org.hibernate.SQL: DEBUG
|
||||
org.hibernate.type.descriptor.sql: TRACE
|
||||
web:
|
||||
application-name: myoa-engineering-logging-sample
|
||||
http-method:
|
||||
excludes:
|
||||
- GET
|
||||
|
|
Loading…
Reference in New Issue