---
title: How to Install the Nodinite Log4Net Appender NuGet Package in Visual Studio
description: Install the Nodinite Log4Net Appender NuGet package in Visual Studio to enable centralized logging for your .NET Framework applications. Step-by-step guide using NuGet Package Manager and CLI.
---

:ReleaseNotes(https://portal.nodinite.com/marketplace/17):

# :fa-rocket: 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][Log4Net - Implementing] user guide.

## :fa-square-plus: Before you begin  

Ensure you meet all [prerequisites][], including Visual Studio (2019 or later) and a .NET Framework 4.6.2+ project.

## :fa-forward-step: 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)

1. Open your .NET Framework project in Visual Studio
2. Right-click on the project in **Solution Explorer**
3. Select **Manage NuGet Packages...**
4. Click the **Browse** tab
5. Search for `Nodinite.LogAgent.Log4NetAppender`
6. Select the package and click **Install**
7. Accept any license agreements and dependency installations

### Option B: Package Manager Console

1. Open Visual Studio
2. Go to **Tools** > **NuGet Package Manager** > **Package Manager Console**
3. Run the following command:

```powershell
Install-Package Nodinite.LogAgent.Log4NetAppender
```

### Option C: .NET CLI

Open a command prompt or terminal in your project directory and run:

```bash
dotnet add package Nodinite.LogAgent.Log4NetAppender
```

### What Gets Installed

The NuGet package automatically installs the following dependencies:

* `Nodinite.LogAgent.Log4NetAppender.dll` - The main appender library
* `IBSS.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.

## :fa-forward-step: Step 2: Configure the Appender  

Add or update your `log4net.config` file (or configure within `App.config` / `Web.config`) with the Nodinite appender configuration:

```xml
<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>
```

>[!IMPORTANT]
>Update the `LogApiServiceURI` value to point to your :Nodinite: [Log API][] endpoint. Use HTTPS for production environments. The host and port come from your environment's settings in the :Nodinite: Portal ([Servers step][]).

>[!TIP]
>The configuration creates rich [JSON Log Events][JSON Log Event] that are sent to :Nodinite:. Customize values like `EndPointName`, `ProcessingMachineName`, and `ModuleType` to match your application and environment.

### Key Configuration Parameters

|Parameter|Description|Example|  
|---|---|---|  
|:fa-link: `LogApiServiceURI`|URL of the Nodinite Log API endpoint|`https://nodinite.company.local:40002/LogAPI/`|  
|:fa-tag: `EndPointName`|Friendly name for your application|`Customer Portal API`|  
|:fa-link: `EndPointUri`|Unique identifier for the application instance|`customerportal.prod.company.local`|  
|:fa-fingerprint: `LogAgentID`|Unique ID for this log agent (obtain from Nodinite)|`101`|  
|:fa-filter: `level`|Minimum log level to capture|`INFO`, `WARN`, `ERROR`, `DEBUG`|  

For detailed configuration options, see the [Configuration][] page.

## :fa-forward-step: 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

```csharp
using log4net;
using log4net.Config;

// In Main method
XmlConfigurator.Configure(new FileInfo("log4net.config"));
```

### For ASP.NET Applications

```csharp
// In Global.asax.cs Application_Start
XmlConfigurator.Configure(new FileInfo(Server.MapPath("~/log4net.config")));
```

### For ASP.NET Core / .NET Framework Hybrid

```csharp
// In Startup.cs or Program.cs
XmlConfigurator.Configure(new FileInfo("log4net.config"));
```

## :fa-forward-step: Step 4: Verify Installation

Test that the appender is working correctly:

```csharp
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

>[!NOTE]
>The Log4Net Appender is distributed as a NuGet package. Release notes and version history are maintained in the :Nodinite: Portal, not as a downloadable installation package.

View the latest release information, version history, and changelogs:

:fa-file-alt: [View Release Notes in Nodinite Portal](https://portal.nodinite.com/marketplace/17)<sup>:fa-arrow-up-right-from-square:</sup><sup>:fa-arrow-up-right-from-square:</sup>

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.

---

## :fa-user-md: Support  

If you encounter issues during installation, contact [Support][].

>[!NOTE]  
>Additional troubleshooting information may be available in the Windows Event Logs or in your application's log output.  

## :fa-question: Frequently asked questions  

Find more solutions and answers in the [Troubleshooting][] user guide for the :Nodinite: [Log4Net Appender][Log4Net Appender].

---

## :fa-hand-point-right: Next Steps

* :fa-edit: [Configuration][] - Learn about advanced configuration options  
* :fa-flask: [Implement in a new .NET application][Log4Net - Implementing] - Step-by-step implementation guide  

## :fa-link-horizontal: Related Topics

* :fa-clipboard-check: [Prerequisites][]  
* :fa-arrow-turn-up: [Update][]  
* :fa-trash-can: [Uninstall][]  
* :fa-cloud-arrow-down: [Log API][]  
* :fa-search: [Log Views][]  

[Configuration]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Getting%20started/3.%20Configuration.md
[JSON Log Event]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Log4Net - Implementing]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Troubleshooting/Implement%20in%20a%20new%20.NET%20application.md
[Log4Net Appender]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Overview.md
[Prerequisites]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Getting%20started/1.%20Prerequisites.md
[Servers step]:{ndr}/Install%20and%20Update/Getting%20started/Version%207/Install%20Nodinite%20v7%20Steps/04%20-%20Servers.md#core-platform-services
[Support]:https://support.nodinite.com
[Troubleshooting]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Troubleshooting/Overview.md
[Uninstall]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Troubleshooting/Uninstalling.md
[Update]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Updating.md
[Web Client]:{ndr}/Getting%20Started/Overview.md