Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Logging
Overview
This feature collects the log-centric utilities used by the Eltheon runtime. It includes models describing Serilog log lines, services that rotate/ archive log files, and helper factories that expose log metadata to the admin dashboard or external tooling.
Key Pieces
LogEntry,LogShortEntry,LogFileprovide strongly-typed access to log metadata so Razor pages and APIs can filter or present log summaries without parsing raw text.ArchiveLogsService : BaseServiceintegrates with the Service feature to periodically move or delete stale log files using the sharedGlobalConfigpaths.- Factories and middleware make it simple to register archive services, expose log endpoints or plug in additional sinks.
- The Logs admin surface is a Pattern-B Razor Class Library: the page shell,
/api/v1/admin/logs/queryAPI, DTOs, typed permission, navigation provider, resources, and feature JavaScript are owned by this package.
Usage
builder.Services.AddSingleton<ArchiveLogsService>();
builder.Services.AddHostedService<ArchiveLogsService>();
builder.Services.AddEltheonLoggingAdmin();
builder.Services.AddRazorPages()
.AddEltheonLoggingApplicationPart();
builder.Services.AddMvc()
.AddEltheonLoggingApplicationPart();
Configure GlobalConfig.LogPath before the host starts so the archive service knows where to look. Service triggers can be defined through ServiceConfig JSON files to control archive cadence.
Admin Logs
AddEltheonLoggingAdmin() registers the file-backed query service, the System.Logs.View permission, and the Admin navigation entry. The Razor shell remains available at /Admin/Logs/Index and loads entries through POST /api/v1/admin/logs/query.
The query endpoint supports file selection, text search, level filtering, sorting, server-side paging, compact summary data, and safe diagnostics. Export, delete, and clear actions are intentionally not included because the source page did not provide those operations.
Log queries are bounded by LoggingRuntimeConfig.Viewer:
DefaultPageSizeMaxPageSizeMaxScanLinesMaxReadBytesMaxParseErrorsToKeepEnableChartsEnableLiveRefresh
Malformed lines are counted and returned through query diagnostics. The viewer logs at most one warning per query instead of logging one error per malformed line.
Serilog compact JSON message templates are rendered server-side. The API keeps messageTemplate for diagnostics and returns message for table display, including common properties such as SourceContext, request fields, exception, trace id, span id, request id, and connection id.
The page uses the package static web asset _content/Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Logging/eltheon/features/logs/logs-admin.js. Hosts that consume the package through NuGet must register the application part so the RCL page and API controller are discoverable after pack/install.
Diagnostics
Because the archive service inherits from BaseService, each run is tracked in the Service feature’s execution history, which also feeds the Admin Dashboard. Enable the logging category Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Logging to observe archive operations or serialization errors when reading log files.
Logging Events
AddArchiveLogsConfig() registers Logging event metadata and a LoggingEventPublisher for targeted failure/configuration paths:
Eltheon.Logging.SinkFailedEltheon.Logging.ConfigurationChanged
Automatic sink wrapping is intentionally deferred until concrete sink failure points exist in this package. Publishers must pass safe identifiers only; log payloads and sink secrets must not be included.
Runtime Logging Config
AddEltheonLoggingRuntimeConfig() registers LoggingRuntimeConfig, the Serilog level switch registry, runtime control, and the config-change event bridge. Hosts can bind Serilog to LoggingLevelSwitchRegistry so Default, Microsoft, System, and Redeon levels can be adjusted without rebuilding the logger pipeline. Request logging and sink structure still depend on host middleware/sink registration and may require restart depending on host wiring.
Metrics
With the Metrik feature enabled and AddMetricsLogging() registered, every log entry of level Warning+ increments:
eltheon_logs_total{severity,category}- counter per log severity and normalized low-cardinality category. The counter is cached and can be disabled throughLoggingRuntimeConfig.MetricsLoggingEnabled.