Installing the Nodinite Log4Net Appender
Section titled “ Installing the Nodinite Log4Net Appender”Add centralized logging to your .NET Framework applications by installing the Nodinite Log4Net Appender NuGet package. This guide provides step-by-step instructions for installation using Visual Studio's NuGet Package Manager, the Package Manager Console, or the .NET CLI.
With this guide, you will:
- ✅ Quickly install the NuGet package in your .NET Framework project
- ✅ Automatically manage dependencies and versioning
- ✅ Configure the appender for seamless integration with Nodinite
- ✅ Start logging to Nodinite with minimal configuration
This guide shows you how to install the Nodinite Log4Net Appender NuGet package and perform basic configuration.
For detailed implementation examples, see the Implement in a new .NET application user guide.
Before you begin
Section titled “ Before you begin”Ensure you meet all prerequisites, including Visual Studio (2019 or later) and a .NET Framework 4.6.2+ project.
Step 1: Install the NuGet Package
Section titled “ Step 1: Install the NuGet Package”Choose one of the following methods to install the Nodinite Log4Net Appender NuGet package in your project:
Option A: Visual Studio NuGet Package Manager (GUI)
Section titled “Option A: Visual Studio NuGet Package Manager (GUI)”- Open your .NET Framework project in Visual Studio
- Right-click on the project in Solution Explorer
- Select Manage NuGet Packages...
- Click the Browse tab
- Search for
Nodinite.LogAgent.Log4NetAppender - Select the package and click Install
- Accept any license agreements and dependency installations
Option B: Package Manager Console
Section titled “Option B: Package Manager Console”- Open Visual Studio
- Go to Tools > NuGet Package Manager > Package Manager Console
- Run the following command:
Install-Package Nodinite.LogAgent.Log4NetAppenderOption C: .NET CLI
Section titled “Option C: .NET CLI”Open a command prompt or terminal in your project directory and run:
dotnet add package Nodinite.LogAgent.Log4NetAppenderWhat Gets Installed
Section titled “What Gets Installed”The NuGet package automatically installs the following dependencies:
Nodinite.LogAgent.Log4NetAppender.dll- The main appender libraryIBSS.Libraries.Contracts.LogRestApi.dll- Log API contracts- Apache
log4net(if not already installed) - Required .NET dependencies (Newtonsoft.Json, System.Text.Json, etc.)
All dependencies are managed automatically by NuGet. The exact versions are determined by the package manifest and will be kept up to date when you update the package.
Step 2: Configure the Appender
Section titled “ Step 2: Configure the Appender”Add or update your log4net.config file (or configure within App.config / Web.config) with the Nodinite appender configuration:
<log4net> <appender name="NodiniteLog4NetAppender" type="Nodinite.LogAgent.Log4NetAppender.NodiniteLog4NetAppender,Nodinite.LogAgent.Log4NetAppender"> <!-- Nodinite Configuration --> <OriginalMessageType value="Nodinite.LogAgent.Log4NetAppender/2.0#DefaultMessageType" /> <MessageTypeExtractFromBody value="false" /> <LogAgentID value="101"/> <EventNumber value="0"/> <EndPointName value="My .NET Application"/> <EndPointUri value="myapp.company.local"/> <ProcessingUser value="SYSTEM"/> <ModuleType value=".NET Application"/> <ProcessName value="MyApp"/> <ProcessingMachineName value="APP-SERVER-01"/> <ProcessingModuleType value=".NET Framework"/> <ProcessingModuleName value="MyApplication"/> <LogApiServiceURI value="https://nodinite.company.local:40002/LogAPI/"/> <ApplicationInterchangeId value="{99106FF5-C7BB-4244-9EB7-F99040190F32}"/> <LocalInterchangeId value="{E4CDDF18-9925-4A79-8E9F-71BC0D4C5172}"/> <ServiceInstanceActivityId value="{E4CDDF18-9925-4A79-8E9F-71BC0D4C5173}"/> </appender>
<root> <level value="INFO"/> <appender-ref ref="NodiniteLog4NetAppender"/> </root></log4net>Key Configuration Parameters
Section titled “Key Configuration Parameters”| Parameter | Description | Example |
|---|---|---|
LogApiServiceURI |
URL of the Nodinite Log API endpoint | https://nodinite.company.local:40002/LogAPI/ |
EndPointName |
Friendly name for your application | Customer Portal API |
EndPointUri |
Unique identifier for the application instance | customerportal.prod.company.local |
LogAgentID |
Unique ID for this log agent (obtain from Nodinite) | 101 |
level |
Minimum log level to capture | INFO, WARN, ERROR, DEBUG |
For detailed configuration options, see the Configuration page.
Step 3: Initialize Log4Net in Your Application
Section titled “ Step 3: Initialize Log4Net in Your Application”Ensure Log4Net is configured to read your configuration file. Add this code to your application startup (e.g., Program.cs, Global.asax.cs, or Startup.cs):
For Console Applications
Section titled “For Console Applications”using log4net;using log4net.Config;
// In Main methodXmlConfigurator.Configure(new FileInfo("log4net.config"));For ASP.NET Applications
Section titled “For ASP.NET Applications”// In Global.asax.cs Application_StartXmlConfigurator.Configure(new FileInfo(Server.MapPath("~/log4net.config")));For ASP.NET Core / .NET Framework Hybrid
Section titled “For ASP.NET Core / .NET Framework Hybrid”// In Startup.cs or Program.csXmlConfigurator.Configure(new FileInfo("log4net.config"));Step 4: Verify Installation
Section titled “ Step 4: Verify Installation”Test that the appender is working correctly:
using log4net;
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
public void TestLogging(){ log.Info("Test message from Nodinite Log4Net Appender"); log.Warn("This is a warning"); log.Error("This is an error", new Exception("Test exception"));}Check the Nodinite Log Views in the Web Client to verify that log events are being received.
Release Notes
Section titled “Release Notes”View the latest release information, version history, and changelogs:
View Release Notes in Nodinite Portal
The Portal provides:
- Current and historical version information
- Feature additions and bug fixes
- Breaking changes and migration guides
- Compatibility notes
To check your installed version, view the package version in Visual Studio's NuGet Package Manager or check your project's .csproj file.
Support
Section titled “ Support”If you encounter issues during installation, contact Support.
Frequently asked questions
Section titled “ Frequently asked questions”Find more solutions and answers in the Troubleshooting user guide for the Nodinite Log4Net Appender.
Next Steps
Section titled “ Next Steps”- Configuration - Learn about advanced configuration options
- Implement in a new .NET application - Step-by-step implementation guide