You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Feature] implement log channel separation and request log level system (#7190)
* feat: implement log channel separation and request log level system
* fix: log system improvements based on review
* add request_id to error logs, use RequestLogLevel enum, and unify logger implementation from utils to logger module
| 0 | LIFECYCLE | Lifecycle start/end | Request creation/initialization, completion stats (InputToken/OutputToken/latency), first and last streaming response, request abort |
25
+
| 1 | STAGES | Processing stages | Semaphore acquire/release, first token time recording, signal handling (preemption/abortion/recovery), cache task, preprocess time, parameter adjustment warnings |
26
+
| 2 | CONTENT | Content and scheduling | Request parameters, processed request, scheduling info (enqueue/pull/finish), response content (long content is truncated) |
27
+
| 3 | FULL | Complete raw data | Complete request and response data, raw received request |
28
+
29
+
Default level is 2 (CONTENT), which logs request parameters, scheduling info, and response content. Lower levels (0-1) only log critical events, while level 3 includes complete raw data.
30
+
31
+
## Log-Related Environment Variables
32
+
33
+
| Variable | Default | Description |
34
+
|----------|---------|-------------|
35
+
|`FD_LOG_DIR`|`log`| Log file storage directory |
36
+
|`FD_LOG_LEVEL`|`INFO`| Log level, supports `INFO` or `DEBUG`|
37
+
|`FD_LOG_REQUESTS`|`1`| Enable request logging, `0` to disable, `1` to enable |
38
+
|`FD_LOG_REQUESTS_LEVEL`|`2`| Request log level, range 0-3 |
39
+
|`FD_LOG_MAX_LEN`|`2048`| Maximum length for L2 level log content (excess is truncated) |
40
+
|`FD_LOG_BACKUP_COUNT`|`7`| Number of log files to retain |
0 commit comments