에러로그 stacktrace 컬럼 수정
This commit is contained in:
@@ -288,14 +288,11 @@ public class GlobalExceptionHandler {
|
|||||||
// TODO : 로그인 개발되면 이것도 연결해야 함
|
// TODO : 로그인 개발되면 이것도 연결해야 함
|
||||||
Long userid = Long.valueOf(Optional.ofNullable(ApiLogFunction.getUserId(request)).orElse("1"));
|
Long userid = Long.valueOf(Optional.ofNullable(ApiLogFunction.getUserId(request)).orElse("1"));
|
||||||
|
|
||||||
// TODO : stackTrace limit 20줄? 확인 필요
|
|
||||||
String stackTraceStr =
|
String stackTraceStr =
|
||||||
Arrays.stream(stackTrace)
|
Arrays.stream(stackTrace)
|
||||||
// .limit(20)
|
.map(StackTraceElement::toString)
|
||||||
.map(StackTraceElement::toString)
|
.collect(Collectors.joining("\n"))
|
||||||
.collect(Collectors.joining("\n"))
|
.substring(0, Math.min(stackTrace.length, 255));
|
||||||
.substring(0, Math.min(stackTrace.length, 255));
|
|
||||||
;
|
|
||||||
|
|
||||||
ErrorLogEntity errorLogEntity =
|
ErrorLogEntity errorLogEntity =
|
||||||
new ErrorLogEntity(
|
new ErrorLogEntity(
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.kamco.cd.kamcoback.log.dto.EventType;
|
|||||||
import com.kamco.cd.kamcoback.postgres.CommonCreateEntity;
|
import com.kamco.cd.kamcoback.postgres.CommonCreateEntity;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -32,7 +34,8 @@ public class ErrorLogEntity extends CommonCreateEntity {
|
|||||||
private String errorCode;
|
private String errorCode;
|
||||||
private String errorMessage;
|
private String errorMessage;
|
||||||
|
|
||||||
@Column(columnDefinition = "TEXT")
|
@Size(max = 255)
|
||||||
|
@Column(name = "stack_trace")
|
||||||
private String stackTrace;
|
private String stackTrace;
|
||||||
|
|
||||||
private Long handlerUid;
|
private Long handlerUid;
|
||||||
|
|||||||
Reference in New Issue
Block a user