diff --git a/agent/app/model/runtime.go b/agent/app/model/runtime.go
index 510fe94e7..f32ce315b 100644
--- a/agent/app/model/runtime.go
+++ b/agent/app/model/runtime.go
@@ -49,3 +49,7 @@ func (r *Runtime) GetPHPPath() string {
func (r *Runtime) GetLogPath() string {
return path.Join(r.GetPath(), "build.log")
}
+
+func (r *Runtime) GetSlowLogPath() string {
+ return path.Join(r.GetPath(), "log", "fpm.slow.log")
+}
diff --git a/agent/app/service/file.go b/agent/app/service/file.go
index 251ec5b2b..06f40fd55 100644
--- a/agent/app/service/file.go
+++ b/agent/app/service/file.go
@@ -560,6 +560,12 @@ func (f *FileService) ReadLogByLine(req request.FileReadByLineReq) (*response.Fi
logFilePath = path.Join(global.Dir.DataDir, fmt.Sprintf("apps/mysql/%s/data/1Panel-slow.log", req.Name))
case "mariadb-slow-logs":
logFilePath = path.Join(global.Dir.DataDir, fmt.Sprintf("apps/mariadb/%s/db/data/1Panel-slow.log", req.Name))
+ case "php-fpm-slow-logs":
+ php, err := runtimeRepo.GetFirst(context.Background(), repo.WithByID(req.ID))
+ if err != nil {
+ return nil, err
+ }
+ logFilePath = php.GetSlowLogPath()
}
file, err := os.Open(logFilePath)
diff --git a/frontend/src/views/website/runtime/php/config/index.vue b/frontend/src/views/website/runtime/php/config/index.vue
index 64ecea5d8..4e6dbdb89 100644
--- a/frontend/src/views/website/runtime/php/config/index.vue
+++ b/frontend/src/views/website/runtime/php/config/index.vue
@@ -29,6 +29,9 @@
+
+
+
@@ -51,6 +54,7 @@ import Performance from './performance/index.vue';
import Container from './container/index.vue';
import FpmStatus from './fpm-status/index.vue';
import Timeout from './timeout/index.vue';
+import SlowLog from './slow-log/index.vue';
const index = ref('6');
const open = ref(false);
diff --git a/frontend/src/views/website/runtime/php/config/slow-log/index.vue b/frontend/src/views/website/runtime/php/config/slow-log/index.vue
new file mode 100644
index 000000000..b8aac14cf
--- /dev/null
+++ b/frontend/src/views/website/runtime/php/config/slow-log/index.vue
@@ -0,0 +1,16 @@
+
+
+
+
+