Starhead.LogEvent
1.0.0
dotnet add package Starhead.LogEvent --version 1.0.0
NuGet\Install-Package Starhead.LogEvent -Version 1.0.0
<PackageReference Include="Starhead.LogEvent" Version="1.0.0" />
<PackageVersion Include="Starhead.LogEvent" Version="1.0.0" />
<PackageReference Include="Starhead.LogEvent" />
paket add Starhead.LogEvent --version 1.0.0
#r "nuget: Starhead.LogEvent, 1.0.0"
#:package Starhead.LogEvent@1.0.0
#addin nuget:?package=Starhead.LogEvent&version=1.0.0
#tool nuget:?package=Starhead.LogEvent&version=1.0.0
Starhead.LogEvent
Client wrapper for the Starhead Trace External API (/ext/api/v1) — send and query error, user activity, audit trail, and payment events. Handles the three required authentication headers (x-api-key, x-timestamp, x-signature, HMAC-SHA512 signed) transparently on every request.
Installation
dotnet add package Starhead.LogEvent
Usage with dependency injection
services.AddStarheadLogClient(options =>
{
options.BaseUrl = "https://trace.starhead.example";
options.ApiKey = "your-api-key";
options.SecretKey = "your-secret-key";
});
StarheadLogClient is registered as a typed HttpClient, so it benefits from IHttpClientFactory pooling. Inject it wherever needed:
public class MyService(StarheadLogClient logClient)
{
public Task LogAsync(AuditTrailEvent e, CancellationToken ct) =>
logClient.LogAuditTrailAsync(e, ct);
}
Usage without DI
var client = new StarheadLogClient(
baseUrl: "https://trace.starhead.example",
apiKey: "your-api-key",
secretKey: "your-secret-key");
Event types
| Event | Log | Get by ID | List / filter |
|---|---|---|---|
ErrorEvent |
LogErrorAsync |
GetErrorByIdAsync |
GetErrorsAsync(ErrorFilter?) |
UserActivityEvent |
LogUserActivityAsync |
GetUserActivityByIdAsync |
GetUserActivitiesAsync(UserActivityFilter?) |
AuditTrailEvent |
LogAuditTrailAsync |
GetAuditTrailByIdAsync |
GetAuditTrailsAsync(AuditTrailFilter?) |
PaymentEvent |
LogPaymentAsync |
GetPaymentByIdAsync |
GetPaymentsAsync(PaymentFilter?) |
List methods return a PagedResult<T> (Data, Page, PageSize, Total, TotalPages). Every filter supports ApplicationName, From/To (UTC date range), Page, and PageSize, plus event-specific fields (e.g. ErrorFilter.Severity, AuditTrailFilter.ActionType).
Example — log an audit trail event
await logClient.LogAuditTrailAsync(new AuditTrailEvent
{
AuditId = Guid.NewGuid(),
ApplicationName = "MyApp",
EventTime = DateTime.UtcNow,
UserId = "user-123",
ActionType = "Update",
EntityType = "Order",
EntityId = "ORD-001",
BeforeState = "{...}",
AfterState = "{...}",
});
Example — query error events
var result = await logClient.GetErrorsAsync(new ErrorFilter
{
ApplicationName = "MyApp",
Severity = "Critical",
From = DateTime.UtcNow.AddDays(-7),
});
Error handling
Non-success responses throw StarheadLogException, which carries the response's HttpStatusCode and body.
Requirements
- .NET 10.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.0.0 | 123 | 7/15/2026 |