\App\ModelsLogSysError

系统错误日志

职责:运行时异常现场(堆栈/位置/请求快照)的审计记录载体, status 承载运维协同(待处理/已处理/已忽略),写路径仅 LogErrorMiddleware。

Summary

Methods
Properties
Constants
timestampCasts()
$timestamps
$id
$user_id
$user_name
$exception_name
$exception_message
$stack_trace
$class_name
$method_name
$line_number
$request_url
$request_method
$request_params
$client_ip
$user_agent
$server_ip
$instance_id
$trace_id
$session_id
$status
$handler
$handle_note
$create_time
STATUS_PENDING
STATUS_HANDLED
STATUS_IGNORED
serializeDate()
casts()
$table
$hidden
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

STATUS_PENDING

STATUS_PENDING = 0

处理状态:待处理

STATUS_HANDLED

STATUS_HANDLED = 1

处理状态:已处理

STATUS_IGNORED

STATUS_IGNORED = 2

处理状态:已忽略

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$user_id

$user_id : int|null

用户ID(未登录触发的异常为空)

Type

int|null

$user_name

$user_name : string

用户名

Type

string

$exception_name

$exception_name : string

异常名

Type

string

$exception_message

$exception_message : string|null

异常消息

Type

string|null

$stack_trace

$stack_trace : string|null

完整堆栈

Type

string|null

$class_name

$class_name : string

发生类名

Type

string

$method_name

$method_name : string

发生方法名

Type

string

$line_number

$line_number : int|null

发生行号

Type

int|null

$request_url

$request_url : string

请求路径

Type

string

$request_method

$request_method : string

请求方法

Type

string

$request_params

$request_params : string|null

请求参数快照(已脱敏)

Type

string|null

$client_ip

$client_ip : string

客户端 IP

Type

string

$user_agent

$user_agent : string

User-Agent

Type

string

$server_ip

$server_ip : string

服务器 IP

Type

string

$instance_id

$instance_id : string

实例标识

Type

string

$trace_id

$trace_id : string|null

链路追踪 ID

Type

string|null

$session_id

$session_id : string|null

会话标识(token_id)

Type

string|null

$status

$status : int

处理状态:0 待处理,1 已处理,2 已忽略

Type

int

$handler

$handler : string

处理人

Type

string

$handle_note

$handle_note : string

处理备注

Type

string

$create_time

$create_time : string

创建时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 处理状态 STATUS_* 分区 2 · 表名与属性 $table / $fillable / casts └────────────────────────────────────────────────────────────┘

Type

string

$table

$table

$hidden

$hidden

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

全库统一的时间列 cast 段(单源:约 22 个模型 casts() 内重复的两行)。 使用方模型 casts() 内 `return array_merge(self::timestampCasts(), [...])`。

Returns

array

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

所有日期属性统一按 "年-月-日 时:分:秒" 序列化。

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —