fix(server): cap Serilog file-sink retention and size (mxaccessgw#208)
Set retainedFileCountLimit=30, fileSizeLimitBytes=50 MiB and rollOnFileSizeLimit=true on the file sink in appsettings.json and appsettings.Development.json; document under a new Logging section in docs/GatewayConfiguration.md; add a guard test over the shipped config.
This commit is contained in:
@@ -742,6 +742,22 @@ protected DACL whose only entry grants its own account (the account the worker
|
||||
is launched as); on the non-Windows test matrix it uses
|
||||
`PipeOptions.CurrentUserOnly`. See `WorkerPipeSecurity` and [Worker Frame Protocol](./WorkerFrameProtocol.md).
|
||||
|
||||
## Logging (Serilog file sink)
|
||||
|
||||
Logging is configured under the top-level `Serilog` section (not `MxGateway`) in `appsettings.json`. The file
|
||||
sink writes `logs/mxgateway-<date>.log` and is bounded so a long-running gateway cannot fill its disk:
|
||||
|
||||
| Key (`Serilog:WriteTo:1:Args:`) | Shipped value | Meaning |
|
||||
|---|---|---|
|
||||
| `rollingInterval` | `Day` | A new file per day. |
|
||||
| `retainedFileCountLimit` | `30` | Keep at most 30 files; older ones are deleted when a new file is created. |
|
||||
| `fileSizeLimitBytes` | `52428800` (50 MiB) | Per-file size cap. |
|
||||
| `rollOnFileSizeLimit` | `true` | Start a new file at the cap instead of silently dropping events for the rest of the day (the Serilog default when a size limit is set without this flag). |
|
||||
|
||||
Worst-case on-disk log footprint is therefore about `retainedFileCountLimit x fileSizeLimitBytes` (1.5 GiB).
|
||||
Raise or lower these in the deployed `appsettings.json` (or via `Serilog__WriteTo__1__Args__*` environment
|
||||
variables) to fit the host's disk budget.
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [Gateway Process Detailed Design](./GatewayProcessDesign.md)
|
||||
|
||||
Reference in New Issue
Block a user