Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2024-11-21 16:55:11 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-11-21 16:55:11 +0300
commitc21ed90da07631b57e5d9dda0bf23e15c8e77f42 (patch)
tree6b60e530ed9080af5dc8a81dfe4b8a1268081d41
parent9b58277945f7c734bb4fddfa5836d5467544d6fd (diff)
Core crash report
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
-rw-r--r--xray/process.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/xray/process.go b/xray/process.go
index db8509eb..58d14a1f 100644
--- a/xray/process.go
+++ b/xray/process.go
@@ -226,6 +226,7 @@ func (p *process) Start() (err error) {
if err != nil {
logger.Error("Failure in running xray-core:", err)
p.exitErr = err
+ p.witeCrachReport(err)
}
}()
@@ -241,3 +242,8 @@ func (p *process) Stop() error {
}
return p.cmd.Process.Signal(syscall.SIGTERM)
}
+
+func (p *process) witeCrachReport(err error) error {
+ crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log"
+ return os.WriteFile(crashReportPath, []byte(err.Error()), os.ModePerm)
+}