Update logging configuration to support daily log files and implement log pruning; add guidance in CLAUDE.md and enhance README.md with command usage

This commit is contained in:
2026-06-27 14:04:44 +08:00
parent 4685a0165d
commit 2fc815b788
6 changed files with 326 additions and 18 deletions

View File

@@ -13,6 +13,12 @@ uv run nexus-claude-api config set --api-key "your-nexus-api-key"
uv run nexus-claude-api start --port 4141 --claude-code
```
If the `nexus-claude-api` command is not on your `PATH`, run the module entrypoint instead:
```powershell
py -m nexus_claude_api start --port 4141 --claude-code
```
Use the printed Claude Code command in the same shell.
`ANTHROPIC_AUTH_TOKEN='dummy'` in the printed command is only a local Claude Code compatibility placeholder. Claude Code expects an Anthropic auth token variable to exist, but this local proxy does not validate it by default. It is not your Nexus key.
@@ -40,7 +46,7 @@ Credential lookup order:
To write user config:
```powershell
nexus-claude-api config set --api-key "your-nexus-api-key"
uv run nexus-claude-api config set --api-key "your-nexus-api-key"
```
This creates `~/.config/nexus-claude-api/config.json`:
@@ -51,7 +57,7 @@ This creates `~/.config/nexus-claude-api/config.json`:
}
```
Logs are written to `~/.config/nexus-claude-api/logs/nexus-claude-api.log` by default.
Logs are written to dated files under `~/.config/nexus-claude-api/logs/` by default, for example `nexus-claude-api-2026-06-27.log`. The service keeps the latest 7 daily log files and prunes older dated log files automatically.
For repository-local development only, pass `--dev` and create `nexus-claude-api.local.json` in the current directory:
@@ -59,7 +65,7 @@ For repository-local development only, pass `--dev` and create `nexus-claude-api
uv run nexus-claude-api start --dev --port 4141 --claude-code
```
In development mode, config is read from `nexus-claude-api.local.json` and logs are written to `logs/nexus-claude-api.log` in the current directory. The local config file is ignored by git.
In development mode, config is read from `nexus-claude-api.local.json` and daily logs are written to `logs/nexus-claude-api-YYYY-MM-DD.log` in the current directory. The local config file and `logs/` directory are ignored by git.
The service binds to `127.0.0.1` by default and does not persist API keys.