Added EonaCat.LogStack.Status

Updated EonaCat.LogStack.LogClient to support EonaCat.LogStack.Status
This commit is contained in:
2026-03-12 21:15:33 +01:00
parent 776cc624bd
commit 977374ce02
41 changed files with 3412 additions and 180 deletions

View File

@@ -0,0 +1,99 @@
@page
@model Status.Pages.Admin.IngestModel
@{
ViewData["Title"] = "Log Ingestion";
ViewData["Page"] = "admin-ingest";
var host = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host}";
}
<div class="section-title mb-2">Log Ingestion API</div>
<p style="color:var(--text-muted);margin-bottom:20px;font-size:13px">
Status accepts logs from any application via HTTP POST. Compatible with custom HTTP sinks from Serilog, NLog, log4net, and any HTTP client.
</p>
<div class="two-col" style="align-items:start">
<div>
<div class="card mb-2">
<div class="card-header"><span class="card-title">Single Log Entry</span></div>
<div class="card-body">
<div style="font-family:var(--font-mono);font-size:11px;background:var(--bg-base);padding:14px;border-radius:4px;line-height:1.8;white-space:pre-wrap;overflow-x:auto">POST @host/api/logs/ingest
Content-Type: application/json
{
"source": "my-app",
"level": "error",
"message": "Something went wrong",
"exception": "System.Exception: ...",
"properties": "{\"userId\": 42}",
"host": "prod-server-01",
"traceId": "abc123"
}</div>
</div>
</div>
<div class="card mb-2">
<div class="card-header"><span class="card-title">Batch Ingestion</span></div>
<div class="card-body">
<div style="font-family:var(--font-mono);font-size:11px;background:var(--bg-base);padding:14px;border-radius:4px;line-height:1.8;white-space:pre-wrap;overflow-x:auto">POST @host/api/logs/batch
Content-Type: application/json
[
{"source":"app","level":"info","message":"Started"},
{"source":"app","level":"warn","message":"Slow query","properties":"{\"ms\":2400}"}
]</div>
</div>
</div>
</div>
<div>
<div class="card mb-2">
<div class="card-header"><span class="card-title">EonaCat.LogStack HTTP Flow (.NET)</span></div>
<div class="card-body">
<div style="font-family:var(--font-mono);font-size:11px;background:var(--bg-base);padding:14px;border-radius:4px;line-height:1.8;white-space:pre-wrap;overflow-x:auto">// Install: EonaCat.LogStack
var logger = new LogBuilder().WriteToHttp("@host/api/logs/eonacat").Build();
</div>
</div>
</div>
<div class="card mb-2">
<div class="card-header"><span class="card-title">Serilog HTTP Sink (.NET)</span></div>
<div class="card-body">
<div style="font-family:var(--font-mono);font-size:11px;background:var(--bg-base);padding:14px;border-radius:4px;line-height:1.8;white-space:pre-wrap;overflow-x:auto">
// Install: Serilog.Sinks.Http
Log.Logger = new LoggerConfiguration()
.WriteTo.Http(
requestUri: "@host/api/logs/serilog",
queueLimitBytes: null)
.CreateLogger();
</div>
</div>
</div>
<div class="card mb-2">
<div class="card-header"><span class="card-title">Python (requests)</span></div>
<div class="card-body">
<div style="font-family:var(--font-mono);font-size:11px;background:var(--bg-base);padding:14px;border-radius:4px;line-height:1.8;white-space:pre-wrap;overflow-x:auto">import requests
requests.post("@host/api/logs/ingest", json={
"source": "my-python-app",
"level": "info",
"message": "App started",
"host": socket.gethostname()
})</div>
</div>
</div>
<div class="card">
<div class="card-header"><span class="card-title">Log Levels</span></div>
<div class="card-body">
<table class="data-table">
<tr><td><span class="badge badge-unknown">DEBUG</span></td><td style="font-size:12px">Verbose diagnostic info</td></tr>
<tr><td><span class="badge badge-info">INFO</span></td><td style="font-size:12px">Normal operation events</td></tr>
<tr><td><span class="badge badge-warn">WARNING</span></td><td style="font-size:12px">Warning requires attention</td></tr>
<tr><td><span class="badge badge-down">ERROR</span></td><td style="font-size:12px">Errors requiring attention</td></tr>
<tr><td><span class="badge badge-down">CRITICAL</span></td><td style="font-size:12px">System critical failure / crash</td></tr>
</table>
</div>
</div>
</div>
</div>