package org.xyzh.system.log;

import org.apache.logging.log4j.core.LogEvent;

/**
 * @description 日志事件上下文 - 包含日志事件和HTTP上下文信息
 * @filename LogEventContext.java
 * @author yslg
 * @copyright xyzh
 * @since 2025-10-30
 */
public class LogEventContext {
    
    private final LogEvent logEvent;
    private final String userId;
    private final String username;
    private final String requestUrl;
    private final String requestMethod;
    private final String ipAddress;
    private final String ipSource;
    private final String browser;
    private final String os;
    
    public LogEventContext(LogEvent logEvent, String userId, String username,
                          String requestUrl, String requestMethod,
                          String ipAddress, String ipSource,
                          String browser, String os) {
        this.logEvent = logEvent;
        this.userId = userId;
        this.username = username;
        this.requestUrl = requestUrl;
        this.requestMethod = requestMethod;
        this.ipAddress = ipAddress;
        this.ipSource = ipSource;
        this.browser = browser;
        this.os = os;
    }
    
    public LogEvent getLogEvent() {
        return logEvent;
    }
    
    public String getUserId() {
        return userId;
    }
    
    public String getUsername() {
        return username;
    }
    
    public String getRequestUrl() {
        return requestUrl;
    }
    
    public String getRequestMethod() {
        return requestMethod;
    }
    
    public String getIpAddress() {
        return ipAddress;
    }
    
    public String getIpSource() {
        return ipSource;
    }
    
    public String getBrowser() {
        return browser;
    }
    
    public String getOs() {
        return os;
    }
}

