Vue.component("http-access-log-config-box", { props: ["v-access-log-config", "v-fields", "v-default-field-codes", "v-is-location", "v-is-group"], data: function () { let that = this // 初始化 setTimeout(function () { that.changeFields() }, 100) let accessLog = { isPrior: false, isOn: false, fields: [1, 2, 6, 7], status1: true, status2: true, status3: true, status4: true, status5: true, firewallOnly: false, enableClientClosed: false } if (this.vAccessLogConfig != null) { accessLog = this.vAccessLogConfig } this.vFields.forEach(function (v) { if (that.vAccessLogConfig == null) { // 初始化默认值 v.isChecked = that.vDefaultFieldCodes.$contains(v.code) } else { v.isChecked = accessLog.fields.$contains(v.code) } }) return { accessLog: accessLog, hasRequestBodyField: this.vFields.$contains(8), showAdvancedOptions: false } }, methods: { changeFields: function () { this.accessLog.fields = this.vFields.filter(function (v) { return v.isChecked }).map(function (v) { return v.code }) this.hasRequestBodyField = this.accessLog.fields.$contains(8) }, changeAdvanced: function (v) { this.showAdvancedOptions = v } }, template: `
| 启用访问日志 |
|
| 基础信息 | 默认记录客户端IP、请求URL等基础信息。 |
| 高级信息 |
在基础信息之外要存储的信息。 记录"请求Body"将会显著消耗更多的系统资源,建议仅在调试时启用,最大记录尺寸为2MiB。 |
| 要存储的访问日志状态码 |
|
| 记录客户端中断日志 |
以 |
| 只记录WAF相关日志 |
选中后只记录WAF相关的日志。通过此选项可有效减少访问日志数量,降低网络带宽和存储压力。 |