EventLogHelper 2025.7.26.13
See the version list below for details.
dotnet add package EventLogHelper --version 2025.7.26.13
NuGet\Install-Package EventLogHelper -Version 2025.7.26.13
<PackageReference Include="EventLogHelper" Version="2025.7.26.13" />
<PackageVersion Include="EventLogHelper" Version="2025.7.26.13" />
<PackageReference Include="EventLogHelper" />
paket add EventLogHelper --version 2025.7.26.13
#r "nuget: EventLogHelper, 2025.7.26.13"
#:package EventLogHelper@2025.7.26.13
#addin nuget:?package=EventLogHelper&version=2025.7.26.13
#tool nuget:?package=EventLogHelper&version=2025.7.26.13
EventLogHelper
EventLogHelper is a lightweight .NET library designed to make logging to the Windows Event Log simple, safe, and flexible โ without requiring repetitive boilerplate or administrative headaches.
๐ Features
- โ One-line logging to the Windows Event Log
- โ Automatically creates event sources (with safe fall back)
- โ Works in non-elevated environments
- โ
Configurable defaults via
App.config
orWeb.config
- โ Gracefully handles permission issues and registry conflicts
- โ Supports structured messages and custom log levels
๐ก Why Use EventLogHelper?
The built-in .NET
System.Diagnostics.EventLog
API requires:
- Admin rights to create sources
- Manually checking for source/log conflicts
- Verbose, repeated code everywhere you want to log
EventLogHelper abstracts all that into a single method call, with smart defaults and self-healing behavior.
๐ ๏ธ Installation
You can add EventLogHelper to your project by cloning or adding the source file directly (NuGet package coming soon).
๐งพ Example Usage
using EventLogHelper;
SmartEventLogger.Log("App started.");
SmartEventLogger.Log("Invalid user input", EventLogEntryType.Warning);
SmartEventLogger.Log("Fatal error", EventLogEntryType.Error);
You can optionally specify the source and log:
SmartEventLogger.Log("Service initialized.", EventLogEntryType.Information, source: "MyService", logName: "MyCompanyLog");
โ๏ธ Configuration (App.config)
<configuration>
<appSettings>
<add key="EventLog.DefaultLogName" value="Application" />
<add key="EventLog.DefaultSource" value="MyApp" />
<add key="EventLog.FallbackToLogNameOnError" value="true" />
<add key="EventLog.LogLevel" value="Information" />
</appSettings>
</configuration>
๐ Security Notes
- Creating new sources requires admin privileges.
- In non-elevated environments, EventLogHelper will automatically fall back to an existing source (e.g., the log name or "Application").
๐ฆ Roadmap
- Structured logging support
- Optional fallback to file or ETW
๐ Contributions
Contributions are welcome! Please file issues or open pull requests to suggest improvements, report bugs, or extend functionality.
๐ License
MIT License. See LICENSE for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows10.0.17763 is compatible. net9.0-windows was computed. net9.0-windows10.0.17763 is compatible. net10.0-windows was computed. |
.NET Framework | net35 is compatible. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 is compatible. |
This package has no dependencies.
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 |
---|---|---|
2025.9.10.2 | 39 | 9/10/2025 |
2025.9.8.1 | 50 | 9/8/2025 |
2025.8.18.1 | 129 | 8/19/2025 |
2025.8.17.2 | 127 | 8/18/2025 |
2025.8.17.1 | 124 | 8/18/2025 |
2025.8.16.1 | 56 | 8/16/2025 |
2025.8.10.1 | 126 | 8/11/2025 |
2025.8.7.1 | 208 | 8/7/2025 |
2025.8.3.1 | 168 | 8/4/2025 |
2025.8.2.1 | 69 | 8/2/2025 |
2025.7.26.13 | 107 | 7/27/2025 |