mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-15 18:30:47 +08:00
feat: unify runtime logging (rotating files, log root, scripts, desktop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
86d4bad107
commit
1490bd5f24
25 changed files with 541 additions and 53 deletions
|
|
@ -27,9 +27,12 @@ The app will:
|
|||
2. Start backend using `python -m runtime.operations gateway start --host 127.0.0.1 --port <port>`.
|
||||
3. Open `http://127.0.0.1:<port>/chat` in the desktop window.
|
||||
|
||||
Logs are written under:
|
||||
Logs (embedded backend, desktop shell, optional WeCom channel child) are written under the **runtime log root** (same as `AIA_RUNTIME_LOG_DIR` / `data/logs/` — see repo root [`docs/LOGGING.md`](../docs/LOGGING.md)). When launched via `runtime/operations/scripts/start_desktop.ps1`, `OCLAW_DESKTOP_LOG_ROOT` is set for you.
|
||||
|
||||
- `%APPDATA%/oclaw/logs/backend.log` (Windows)
|
||||
Typical files:
|
||||
|
||||
- `desktop.log`
|
||||
- `backend.log`
|
||||
|
||||
## Environment knobs
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,16 @@ const APP_ICON_PATH = (() => {
|
|||
}
|
||||
return candidates[candidates.length - 1];
|
||||
})();
|
||||
const REPO_ROOT_FOR_LOGS = path.resolve(__dirname, "..");
|
||||
function resolveFileLogRoot() {
|
||||
const fromEnv = String(
|
||||
process.env.OCLAW_DESKTOP_LOG_ROOT || process.env.AIA_RUNTIME_LOG_DIR || ""
|
||||
).trim();
|
||||
if (fromEnv) return path.resolve(fromEnv);
|
||||
return path.join(REPO_ROOT_FOR_LOGS, "data", "logs");
|
||||
}
|
||||
const DATA_ROOT = path.join(app.getPath("userData"), "runtime-data");
|
||||
const LOG_ROOT = path.join(app.getPath("userData"), "logs");
|
||||
const LOG_ROOT = resolveFileLogRoot();
|
||||
const BACKEND_LOG_FILE = path.join(LOG_ROOT, "backend.log");
|
||||
const STARTUP_TIMEOUT_MS = 30000;
|
||||
const POLL_INTERVAL_MS = 600;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue