summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md32
1 files changed, 28 insertions, 4 deletions
diff --git a/README.md b/README.md
index 30b5db8..6ffbdb7 100644
--- a/README.md
+++ b/README.md
@@ -63,6 +63,10 @@ health:
logs:
- /path/to/logs/current.log # up to 4 paths; symlinks resolved
+# OR: watch a directory for new log files (mutually exclusive with logs:)
+log_dir: /path/to/logs # directory to watch
+log_pattern: "L???????.log" # fnmatch glob; default "*" if omitted
+
# Optional filter — any executable reading stdin, writing stdout
log_filter: /usr/lib/umbrella/filters/source.py
@@ -86,19 +90,39 @@ stdout after each write works. Python, shell, compiled binary — anything.
## Log file setup
-srcds and most dedicated servers create new log files per session.
-Point `logs:` at a stable symlink and update it on each server start:
+Two modes are available. They are mutually exclusive per unit.
+
+### Fixed-path mode (`logs:`)
+
+Point `logs:` at a stable symlink; umbrella resolves it via `realpath()`
+at startup and watches the real inode.
```bash
# In your startup script / ExecStartPre:
ln -sf /srv/game/logs/L0222000.log /srv/game/logs/current.log
-# Then SIGHUP umbrella so it re-resolves the symlink:
+# SIGHUP umbrella so it re-resolves the symlink:
kill -HUP $(cat /run/umbrella/umbrella.pid)
```
-With `sv_log_onefile 1` (Source engine), the log file is fixed for the
+With `sv_log_onefile 1` (Source engine), the log file is stable for the
server's lifetime, so the symlink only needs updating on restarts.
+### Directory-watch mode (`log_dir` + `log_pattern`)
+
+Valve games (TF2, GMod) create a new timestamped log file on every map
+change (`L0222000.log`, `L0222001.log`, ...). Use `log_dir` so umbrella
+auto-switches to the newest matching file without a SIGHUP:
+
+```yaml
+log_dir: /home/gmod/nnn/gmodds/garrysmod/logs
+log_pattern: "L???????.log"
+```
+
+- `log_pattern` uses `fnmatch(3)` shell-style globs (e.g. `L???????.log`)
+- Omitting `log_pattern` defaults to `"*"` (match all files)
+- `log_dir` and `logs:` cannot be combined; if both appear, `logs:` is
+ ignored with a warning in the daemon log
+
## CLI usage
```bash