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
Copy file name to clipboardExpand all lines: guide/src/guide/worker.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,10 @@ lifetime = "7d"
49
49
# groups are not set, default to the user's group
50
50
# tags are not set
51
51
file_log = false
52
+
# shared_log is not set, default to false. When enabled, all workers share a centralized log file with daily rotation (max 3 files)
52
53
# log_path is not set. It will use the default rolling log file path if file_log is set to true
54
+
# - If shared_log is enabled and log_path is not set, it will use workers.log in cache directory
55
+
# - If shared_log is disabled and log_path is not set, it will use {worker_uuid}.log in cache directory
53
56
# lifetime is not set, default to the coordinator's setting
54
57
```
55
58
@@ -123,3 +126,40 @@ Options:
123
126
-V, --version
124
127
Print version
125
128
```
129
+
130
+
## Logging Configuration
131
+
132
+
Workers support flexible logging configurations to help you track and debug task execution:
133
+
134
+
### File Logging
135
+
136
+
Enable file logging with the `--file-log` flag or by setting `file_log = true` in the configuration file. This will write worker logs to disk for persistent storage.
137
+
138
+
### Shared Rolling Logs (v0.6.5+)
139
+
140
+
Starting from version 0.6.5, workers support shared rolling logs - a centralized logging mechanism that allows multiple workers to write to the same log file with automatic daily rotation:
141
+
142
+
-**Shared Mode**: When `shared_log = true`, all workers write to a single `workers.log` file in the cache directory
143
+
-**Individual Mode**: When `shared_log = false` (default), each worker writes to its own `{worker_uuid}.log` file
144
+
-**Rotation**: Shared logs rotate daily with a maximum of 3 log files retained
145
+
146
+
This feature is particularly useful when managing multiple workers on the same machine, as it simplifies log management and aggregation.
147
+
148
+
**Example configuration:**
149
+
150
+
```toml
151
+
[worker]
152
+
file_log = true
153
+
shared_log = true# Enable shared rolling logs
154
+
# log_path is optional - if not specified, uses default cache directory
155
+
```
156
+
157
+
**Note:** The cache directory location varies by platform:
158
+
159
+
- Linux: `$XDG_CACHE_HOME` or `$HOME/.cache/mitosis`
0 commit comments