IBeam.Services.Logging
2.9.1
dotnet add package IBeam.Services.Logging --version 2.9.1
NuGet\Install-Package IBeam.Services.Logging -Version 2.9.1
<PackageReference Include="IBeam.Services.Logging" Version="2.9.1" />
<PackageVersion Include="IBeam.Services.Logging" Version="2.9.1" />
<PackageReference Include="IBeam.Services.Logging" />
paket add IBeam.Services.Logging --version 2.9.1
#r "nuget: IBeam.Services.Logging, 2.9.1"
#:package IBeam.Services.Logging@2.9.1
#addin nuget:?package=IBeam.Services.Logging&version=2.9.1
#tool nuget:?package=IBeam.Services.Logging&version=2.9.1
IBeam.Services.Logging
IBeam.Services.Logging provides audit and system-log sinks for IBeam service operations.
dotnet add package IBeam.Services.Logging
When To Use This
- You want service CRUD and custom operation changes to be audited.
- You want audit output through
ILogger, a repository, or Azure Table Storage. - You want unexpected API/system errors and service audit records to share a durable
IBeamSystemLogstable. - You need actor/request metadata such as user ID, tenant ID, correlation ID, IP address, user agent, or device ID.
What This Package Contains
| Area | Type(s) | Purpose |
|---|---|---|
| Logger sink | LoggerAuditTrailSink |
Writes audit transactions through ILogger. |
| Repository sink | RepositoryAuditTrailSink |
Persists audit transactions through IBaseRepositoryAsync<ServiceAuditLogEntry>. |
| Azure Table sink | AzureTableSystemLogSink |
Persists system logs and audit transactions to Azure Table Storage. |
| Audit entity | ServiceAuditLogEntry |
Repository-backed audit record model. |
| Actor context | HttpContextAuditActorProvider |
Resolves actor/request fields from ASP.NET Core HttpContext. |
| DI | AddIBeamLoggerAuditTrail, AddIBeamRepositoryAuditTrail, AddIBeamAzureTableSystemLogs, AddIBeamHttpContextAuditActor |
Registers sink and context providers. |
Architecture Fit
API <-- DTO/model object --> Service <-- Entity --> Repository
The service method is the audit boundary. This package stores or transports audit records generated by IBeam.Services; it should not decide whether a user may perform the operation.
Quick Start
Log through ILogger:
builder.Services.AddIBeamLoggerAuditTrail(builder.Configuration);
builder.Services.AddIBeamHttpContextAuditActor();
Persist through an IBeam repository:
builder.Services.AddIBeamRepositoryAuditTrail(builder.Configuration);
builder.Services.AddIBeamHttpContextAuditActor();
Persist to Azure Table Storage:
using IBeam.Services.Logging.AzureTable;
builder.Services.AddIBeamAzureTableSystemLogs(builder.Configuration);
builder.Services.AddIBeamHttpContextAuditActor();
Audit Configuration
Service audit options live under IBeam:Services:Audit:
{
"IBeam": {
"Services": {
"Audit": {
"Enabled": true,
"DefaultMode": "AuditWrites",
"EnableSelectAudits": false,
"SelectMode": "DailyRollup",
"CaptureBefore": true,
"CaptureAfter": true,
"FailOnAuditError": false
}
}
}
}
Azure Table Configuration
Azure Table system-log options live under IBeam:Logging:AzureTable:
{
"IBeam": {
"Logging": {
"AzureTable": {
"StorageConnectionString": "<connection-string>",
"TablePrefix": "IBeam",
"TableName": "SystemLogs",
"CreateTableIfNotExists": true
}
}
}
}
Connection string fallback also checks shared IBeam/Azure Table connection settings such as IBeam:AzureTables, IBeam:ConnectionString, ConnectionStrings:AzureTables, ConnectionStrings:AzureStorage, ConnectionStrings:IBeam, and ConnectionStrings:DefaultConnection.
With TablePrefix = "IBeam" and TableName = "SystemLogs", the physical table is IBeamSystemLogs.
Azure Table Schema
IBeamSystemLogs
Purpose: stores system log events, service audit transactions, and select-audit rollups.
| Field | Purpose |
|---|---|
PartitionKey |
TENANT|{tenantId:D}|DAY|{yyyyMMdd} for tenant audit records, or SYSTEM|DAY|{yyyyMMdd} for system records. |
RowKey |
Event rows use {HHmmssfffffff}|{guid:N}. Rollups use ROLLUP|{sha256}. |
Timestamp |
Azure Table server timestamp. |
ETag |
Azure Table concurrency token. |
OccurredAtUtc |
Time the log/audit event occurred. |
DateUtc |
UTC date string used for grouping and rollups. |
Category |
System, EntityChange, or SelectRollup. |
Source |
System source or service name. |
Level |
Log level, such as Information or Error. |
Message |
Short log or audit action message. |
Detail |
Optional detailed error/log payload. |
ServiceName |
Service class/name that produced the audit event. |
EntityName |
Entity label such as products or patients. |
Operation |
IBeam service operation enum/name. |
Action |
Action name such as products.save. |
EntityId |
Changed entity ID when available. |
TenantId |
Tenant that owns the event. |
ActorId |
User, API credential, agent, or external subject that initiated the call. |
TraceId |
Trace identifier. |
CorrelationId |
Request/operation correlation identifier. |
IpAddress |
Caller IP address when available. |
UserAgent |
Caller user-agent when available. |
DeviceId |
Caller device ID when available. |
BeforeJson |
Entity snapshot before mutation. |
AfterJson |
Entity snapshot after mutation. |
OriginalJson |
Original input/source entity payload. |
TransformedJson |
Transformed output/entity payload. |
IsSelectRollup |
Marks read-query rollup rows. |
QuerySignature |
Hash/signature for read audit rollup grouping. |
FirstSeenUtc |
First time a rollup/event group was seen. |
LastSeenUtc |
Last time a rollup/event group was seen. |
Count |
Rollup count or event count. |
Data Storage
| Sink | Storage |
|---|---|
LoggerAuditTrailSink |
No durable storage; writes through configured logging providers. |
RepositoryAuditTrailSink |
Uses the host's registered IBaseRepositoryAsync<ServiceAuditLogEntry>. |
AzureTableSystemLogSink |
Creates/writes IBeamSystemLogs when configured. |
Extended Docs And Agent Guidance
- AI prompt:
.agent/prompt.md - Root implementation guide:
../.agent/implementation-guide.md - Service logging and audit:
../docs/service-logging-and-audit.md - Service operation permissions:
../docs/service-operation-permissions.md
Agents should wire logging at the application composition root and keep audit decisions in services.
Troubleshooting
| Problem | Likely Cause | Fix |
|---|---|---|
| No audit records appear | IBeam:Services:Audit:Enabled is false or no sink is registered |
Enable audit options and register a sink. |
| Azure table startup fails | Missing connection string or invalid table name | Configure IBeam:Logging:AzureTable and use alphanumeric table names. |
| Audit failures break business calls | FailOnAuditError is true |
Keep it false unless strict audit durability is required. |
| Actor fields are empty | No actor provider registered | Add AddIBeamHttpContextAuditActor() or a custom provider. |
Version Notes
- Targets
net10.0. - Uses
ILogger, IBeam repositories, and Azure Table Storage depending on registration. - Package version is assigned by the repository release workflow.
| 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
- Azure.Data.Tables (>= 12.8.1)
- IBeam.Api (>= 2.9.1)
- IBeam.Repositories (>= 2.9.1)
- IBeam.Services (>= 2.9.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on IBeam.Services.Logging:
| Package | Downloads |
|---|---|
|
IBeam.Identity.Repositories.AzureTable
IBeam modular framework components for .NET APIs and services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.9.1 | 74 | 7/23/2026 |
| 2.9.0 | 106 | 7/21/2026 |
| 2.8.2 | 107 | 7/21/2026 |
| 2.8.1 | 97 | 7/21/2026 |
| 2.8.0 | 104 | 7/21/2026 |
| 2.7.0 | 100 | 7/21/2026 |
| 2.6.0 | 114 | 7/20/2026 |
| 2.5.0 | 111 | 7/17/2026 |
| 2.4.2 | 117 | 7/16/2026 |
| 2.4.1 | 89 | 7/14/2026 |
| 2.4.0 | 107 | 6/24/2026 |
| 2.3.0 | 98 | 6/24/2026 |
| 2.2.0 | 112 | 6/23/2026 |
| 2.1.0 | 105 | 6/23/2026 |
| 2.0.68 | 101 | 6/23/2026 |
| 2.0.66 | 103 | 6/22/2026 |
| 2.0.65 | 101 | 6/22/2026 |
| 2.0.64 | 106 | 6/17/2026 |
| 2.0.63 | 111 | 6/16/2026 |
| 2.0.62 | 113 | 6/16/2026 |