Closed wuai1024 closed 1 year ago
目前你可以在面板设置
->Xray相关设置
内配置模板以启用xray日志,如下所示:
"log": {
"access": "/usr/local/x-ui/bin/access.log",
"error": "/usr/local/x-ui/bin/error.log",
"loglevel": " debug",
"dnsLog": true
},
完整配置参考如下所示:
{
"log": {
"access": "/usr/local/x-ui/bin/access.log",
"error": "/usr/local/x-ui/bin/error.log",
"loglevel": " debug",
"dnsLog": true
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"dns": {
"servers": [
"127.0.0.1"
]
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blocked"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blockedByIp"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "blockedByDomain"
}
],
"policy": {
"levels": {
"0": {
"handshake": 10,
"connIdle": 100,
"uplinkOnly": 2,
"downlinkOnly": 3,
"statsUserUplink": true,
"statsUserDownlink": true,
"bufferSize": 10240
}
},
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true
}
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "hybrid",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"ip": [
"geoip:cn"
],
"outboundTag": "blockedByIp",
"type": "field"
},
{
"type": "field",
"domain": [
"geosite:category-ads-all",
"geosite:cn",
"geosite:tld-cn",
"geosite:private",
"geosite:category-games@cn"
],
"outboundTag": "blockedByDomain"
},
{
"outboundTag": "blocked",
"protocol": [
"bittorrent"
],
"type": "field"
}
]
},
"stats": {}
}
保存配置后重启面板,服务器内使用如下命令实时查看日志:
tail -f /usr/local/x-ui/bin/access.log | grep -v 127.0.0.1
目前你可以在
面板设置
->Xray相关设置
内配置模板以启用xray日志,如下所示:"log": { "access": "/usr/local/x-ui/bin/access.log", "error": "/usr/local/x-ui/bin/error.log", "loglevel": " debug", "dnsLog": true },
完整配置参考如下所示:
{ "log": { "access": "/usr/local/x-ui/bin/access.log", "error": "/usr/local/x-ui/bin/error.log", "loglevel": " debug", "dnsLog": true }, "api": { "services": [ "HandlerService", "LoggerService", "StatsService" ], "tag": "api" }, "dns": { "servers": [ "127.0.0.1" ] }, "inbounds": [ { "listen": "127.0.0.1", "port": 62789, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" } ], "outbounds": [ { "protocol": "freedom", "settings": {} }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blocked" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blockedByIp" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blockedByDomain" } ], "policy": { "levels": { "0": { "handshake": 10, "connIdle": 100, "uplinkOnly": 2, "downlinkOnly": 3, "statsUserUplink": true, "statsUserDownlink": true, "bufferSize": 10240 } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true } }, "routing": { "domainStrategy": "IPIfNonMatch", "domainMatcher": "hybrid", "rules": [ { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { "ip": [ "geoip:cn" ], "outboundTag": "blockedByIp", "type": "field" }, { "type": "field", "domain": [ "geosite:category-ads-all", "geosite:cn", "geosite:tld-cn", "geosite:private", "geosite:category-games@cn" ], "outboundTag": "blockedByDomain" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" } ] }, "stats": {} }
保存配置后重启面板,服务器内使用如下命令实时查看日志:
tail -f /usr/local/x-ui/bin/access.log | grep -v 127.0.0.1
谢谢,我试过了,已经可以了。
再顺带问下,如果这个日志需要按天来分割,请问下如何解决啊。
Welcome
Description of the problem,screencshot would be good
目前增加入站规则后,没有地方能查询到代理的日志。
我是全局旁路由代理的,有些时候需要根据日志查看下 把一些域名加入 【直连】
Version of x-ui
x-ui log or xray log