mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-17 04:34:40 +03:00
xray log - minor change
This commit is contained in:
@@ -41,8 +41,16 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
|||||||
if len(matches) > 3 {
|
if len(matches) > 3 {
|
||||||
level := matches[2]
|
level := matches[2]
|
||||||
msgBody := matches[3]
|
msgBody := matches[3]
|
||||||
|
msgBodyLower := strings.ToLower(msgBody)
|
||||||
|
|
||||||
if strings.Contains(strings.ToLower(msgBody), "failed") {
|
if strings.Contains(msgBodyLower, "tls handshake error") ||
|
||||||
|
strings.Contains(msgBodyLower, "connection ends") {
|
||||||
|
logger.Debug("XRAY: " + msgBody)
|
||||||
|
lw.lastLine = ""
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(msgBodyLower, "failed") {
|
||||||
logger.Error("XRAY: " + msgBody)
|
logger.Error("XRAY: " + msgBody)
|
||||||
} else {
|
} else {
|
||||||
switch level {
|
switch level {
|
||||||
@@ -60,7 +68,16 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
|
|||||||
}
|
}
|
||||||
lw.lastLine = ""
|
lw.lastLine = ""
|
||||||
} else if msg != "" {
|
} else if msg != "" {
|
||||||
if strings.Contains(strings.ToLower(msg), "failed") {
|
msgLower := strings.ToLower(msg)
|
||||||
|
|
||||||
|
if strings.Contains(msgLower, "tls handshake error") ||
|
||||||
|
strings.Contains(msgLower, "connection ends") {
|
||||||
|
logger.Debug("XRAY: " + msg)
|
||||||
|
lw.lastLine = msg
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(msgLower, "failed") {
|
||||||
logger.Error("XRAY: " + msg)
|
logger.Error("XRAY: " + msg)
|
||||||
} else {
|
} else {
|
||||||
logger.Debug("XRAY: " + msg)
|
logger.Debug("XRAY: " + msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user