Flanderzz / TeamSphere-API

To Be Added
1 stars 2 forks source link

Logging and Observability #32

Closed BravinR closed 2 months ago

BravinR commented 2 months ago

logging pattern configuration using

%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:%5level} log_level="%level" ${PID:- } --- [thread="%thread", httpMethod="%X{httpMethod:-null}", httpRequestURI="%X{httpRequestURI-null}", X-Request-ID="%X{requestId:-null}"] [%15.15t] %-40.40logger{39} : %replace(%msg){'\r\n|\n', '\u2028'} %replace(%Exception){'\r\n|\n', '\u2028'}%nopex

Components:

BravinR commented 2 months ago

Example Log Output

2024-06-15 10:00:00.000  INFO log_level="INFO" --- [thread="http-nio-8080-exec-1", httpMethod="GET", httpRequestURI="/api/resource", X-Request-ID="123e4567-e89b-12d3-a456-426614174000"] [http-nio-8080-exec-1] com.example.logging.LoggingInterceptor : START requestId=123e4567-e89b-12d3-a456-426614174000 method=GET uri=/api/resource