비즈니스 로그 구조 생성
서비스별 비즈니스 로그 처리 코드 정리
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.caliverse.admin.mongodb.domain;
|
||||
|
||||
import com.caliverse.admin.domain.entity.log.LogAction;
|
||||
import com.caliverse.admin.domain.entity.log.LogCategory;
|
||||
import com.caliverse.admin.domain.entity.log.LogStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.index.CompoundIndex;
|
||||
import org.springframework.data.mongodb.core.index.Indexed;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Document(collection = "businessLog")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessLog {
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Indexed
|
||||
private LocalDateTime logTime;
|
||||
|
||||
@Indexed
|
||||
private LogCategory category;
|
||||
|
||||
@Indexed
|
||||
private LogAction action;
|
||||
|
||||
@Indexed
|
||||
private LogStatus status;
|
||||
|
||||
private String worker;
|
||||
private String workerIp;
|
||||
|
||||
private String message;
|
||||
|
||||
private String procId;
|
||||
|
||||
private Object domain;
|
||||
|
||||
@CompoundIndex(def = "{'category': 1, 'action': 1, 'logTime': -1}")
|
||||
@CompoundIndex(def = "{'status': 1, 'logTime': -1}")
|
||||
@CompoundIndex(def = "{'procId': 1, 'logTime': -1}")
|
||||
@CompoundIndex(def = "{'category': 1, 'logTime': -1}")
|
||||
@CompoundIndex(def = "{'action': 1, 'logTime': -1}")
|
||||
public static class Indexes {}
|
||||
}
|
||||
Reference in New Issue
Block a user