Skip to content

Commit 453e1c4

Browse files
committed
chore: log thread
1 parent cf7541f commit 453e1c4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

threadworker.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,17 @@ func go_frankenphp_finish_worker_request(threadIndex C.uintptr_t) {
223223
fc.closeContext()
224224
thread.handler.(*workerThread).workerContext = nil
225225

226-
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.scriptFilename), slog.String("url", fc.request.RequestURI))
226+
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("worker", fc.scriptFilename), slog.Int("thread", thread.threadIndex), slog.String("url", fc.request.RequestURI))
227227
}
228228

229229
// when frankenphp_finish_request() is directly called from PHP
230230
//
231231
//export go_frankenphp_finish_php_request
232232
func go_frankenphp_finish_php_request(threadIndex C.uintptr_t) {
233-
fc := phpThreads[threadIndex].getRequestContext()
233+
thread := phpThreads[threadIndex]
234+
fc := thread.getRequestContext()
235+
234236
fc.closeContext()
235237

236-
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.String("url", fc.request.RequestURI))
238+
fc.logger.LogAttrs(context.Background(), slog.LevelDebug, "request handling finished", slog.Int("thread", thread.threadIndex), slog.String("url", fc.request.RequestURI))
237239
}

0 commit comments

Comments
 (0)