mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-31 05:05:33 +08:00
78 lines
3.0 KiB
PHP
78 lines
3.0 KiB
PHP
<?php
|
||
|
||
namespace app\admin\scheme;
|
||
|
||
use app\common\scheme\BaseScheme;
|
||
use app\common\scheme\attribute\Table;
|
||
use app\common\scheme\attribute\Field;
|
||
use app\common\scheme\attribute\Index;
|
||
|
||
#[Table(name: 'nginx_access_log', comment: 'nginx 访问日志明细(解析入库)')]
|
||
#[Index(columns: ['time_local'], name: 'idx_time_local', type: 'NORMAL')]
|
||
#[Index(columns: ['remote_addr'], name: 'idx_remote_addr', type: 'NORMAL')]
|
||
#[Index(columns: ['status'], name: 'idx_status', type: 'NORMAL')]
|
||
#[Index(columns: ['uri'], name: 'idx_uri', type: 'NORMAL')]
|
||
#[Index(columns: ['file_path'], name: 'idx_file_path', type: 'NORMAL')]
|
||
class NginxAccessLog extends BaseScheme
|
||
{
|
||
#[Field(type: 'bigint', nullable: false, unsigned: true, autoIncrement: true, primary: true, comment: '主键ID')]
|
||
public $id;
|
||
|
||
#[Field(type: 'varchar', length: 500, nullable: false, comment: '来源日志文件路径')]
|
||
public $file_path;
|
||
|
||
#[Field(type: 'varchar', length: 45, nullable: false, comment: '客户端 IP(含 IPv6)')]
|
||
public $remote_addr;
|
||
|
||
#[Field(type: 'varchar', length: 100, nullable: true, comment: 'HTTP 认证用户名')]
|
||
public $remote_user;
|
||
|
||
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, comment: '请求时间戳(业务时区)')]
|
||
public $time_local;
|
||
|
||
#[Field(type: 'varchar', length: 10, nullable: true, comment: 'HTTP 方法')]
|
||
public $method;
|
||
|
||
#[Field(type: 'varchar', length: 255, nullable: false, comment: '请求 URI(超 255 截断)')]
|
||
public $uri;
|
||
|
||
#[Field(type: 'varchar', length: 500, nullable: false, default: '', comment: '查询字符串')]
|
||
public $query_string;
|
||
|
||
#[Field(type: 'varchar', length: 10, nullable: true, comment: 'HTTP 协议版本')]
|
||
public $http_version;
|
||
|
||
#[Field(type: 'int', length: 11, default: '0', comment: 'HTTP 状态码')]
|
||
public $status;
|
||
|
||
#[Field(type: 'bigint', default: '0', comment: '响应体字节数')]
|
||
public $body_bytes_sent;
|
||
|
||
#[Field(type: 'varchar', length: 500, nullable: false, default: '', comment: 'Referer')]
|
||
public $http_referer;
|
||
|
||
#[Field(type: 'varchar', length: 500, nullable: false, default: '', comment: 'User-Agent(超 500 截断)')]
|
||
public $http_user_agent;
|
||
|
||
#[Field(type: 'decimal', precision: 10, scale: 3, default: '0.000', comment: 'nginx 请求总耗时(秒)')]
|
||
public $request_time;
|
||
|
||
#[Field(type: 'decimal', precision: 10, scale: 3, default: '0.000', comment: 'upstream 响应时间(秒)')]
|
||
public $upstream_response_time;
|
||
|
||
#[Field(type: 'bigint', default: '0', comment: '总发送字节数(含 header)')]
|
||
public $bytes_sent;
|
||
|
||
#[Field(type: 'varchar', length: 50, nullable: true, comment: '国家(GeoIP 预留)')]
|
||
public $country;
|
||
|
||
#[Field(type: 'varchar', length: 50, nullable: true, comment: '省份(GeoIP 预留)')]
|
||
public $province;
|
||
|
||
#[Field(type: 'varchar', length: 50, nullable: true, comment: '城市(GeoIP 预留)')]
|
||
public $city;
|
||
|
||
#[Field(type: 'int', length: 11, unsigned: true, comment: '入库时间戳')]
|
||
public $create_time;
|
||
}
|