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 the same real capabilities as the migrated template page: file selection, text search, level filtering, and paging. Export, delete, and clear actions are intentionally not included because the source page did not provide those operations.
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.
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 (Warning/Error/Critical) and logger category. Filterable by instance in Prometheus/Grafana.