diff --git a/app.py b/app.py
index ea30432..0c2128f 100644
--- a/app.py
+++ b/app.py
@@ -202,8 +202,8 @@ def get_info():
return json_dump
-@app.route('/get_log')
-def get_log():
+@app.route('/get_access_log')
+def get_access_log():
file = open('/var/log/v2ray/access.log',"r")
content = file.read().split("\n")
min_length = min(20,len(content))
@@ -213,6 +213,18 @@ def get_log():
string = string + content[i] + "
"
return string
+@app.route('/get_error_log')
+def get_error_log():
+ file = open('/var/log/v2ray/error.log',"r")
+ content = file.read().split("\n")
+ min_length = min(20,len(content))
+ content = content[-min_length:]
+ string = ""
+ for i in range(min_length):
+ string = string + content[i] + "
"
+ return string
+
+
@app.route('/gen_ssl',methods=['GET', 'POST'])
def gen_ssl():
diff --git a/templates/log.html b/templates/log.html
index d462c56..04f504e 100644
--- a/templates/log.html
+++ b/templates/log.html
@@ -23,11 +23,11 @@
@@ -60,7 +60,7 @@
+ |
运行日志 (实时刷新)
@@ -73,14 +73,20 @@
| |
---|---|---|
-
-
-
- |
-
- ||
+
+ access.log
+
+
+ |
+
+
+ error.log
+
+
+ |
+