- 3 minutes to read

Installing the Nodinite Log4Net Appender

This guide teaches how to use the Nodinite Log4Net Appender and perform basic configuration to get you started to enable Logging and Monitoring.

Either follow the guide on this page or try the Implement in a new .NET application user guide.

Before you begin

Ensure you comply with the prerequisites.

Step 1: Copy required binaries

Copy at least the following files to the bin folder for the .NET application:

  • Nodinite.LogAgent.Log4NetAppender.dll
  • IBSS.Libraries.Contracts.LogRestApi.dll

These files are also part of the 5.0.2 release, the actual set you are using may differ depending on the version in use:

  • log4net.2.0.15
  • Microsoft.NETCore.Platforms.2.0.0
  • Newtonsoft.Json.13.0.3
  • System.ComponentModel.Annotations.5.0.0
  • System.Configuration.ConfigurationManager.4.5.0
  • System.Net.Http.Json.7.0.1
  • System.Security.AccessControl.4.5.0
  • System.Security.Cryptography.ProtectedData.4.5.0
  • System.Security.Permissions.4.5.0
  • System.Security.Principal.Windows.4.5.0
  • System.Text.Encodings.Web.7.0.0
  • System.Text.Json.7.0.2

When you include the package reference to your project, you will get the proper versions. Make sure to update your binaries occasionally since we regularly update this package.

Step 2: Manage the configuration file

Use Notepad++ to open, or create the log4net.config file, then add the following section:

    <log4net>
	<appender name="Log4NetAppender" type="Nodinite.LogAgent.Log4NetAppender.NodiniteLog4NetAppender,Nodinite.LogAgent.Log4NetAppender">
		<!-- Custom Parameters -->
		<OriginalMessageType value="Nodinite.LogAgent.Log4NetAppender/2.0#DefaultMessageType" />
		<MessageTypeExtractFromBody value="false" />
		<LogAgentID value="101"/>
		<EventNumber value="0"/>
		<EndPointName value="Log4Net Unit Test"/>
		<EndPointUri value="VS.local.log4net.test"/>
		<!--<LogText value =""/>-->
		<!--<LogStatusId value ="255"/>-->
		<ProcessingUser value="Administrator"/>
		<ModuleType value="unit test"/>
		<ProcessName value="unit test"/>
		<ProcessingMachineName value="DEV"/>
		<ProcessingModuleType value="unit test"/>
		<ProcessingModuleName value="VS"/>
		<LogApiServiceURI value="http://localhost/Nodinite/Dev/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="DEBUG"/>
		<appender-ref ref="Log4NetAppender"/>
	</root>
</log4net>

The different XML elements help produce the Nodinite JSON Log Event.

Ensure the Address in the XML Element LogApiServiceURI points to the Nodinite Log API instance.


Support

Contact our Support for additional guidance if you fail to resolve the installation problem.

Note

Additional information to aid the troubleshooting may exist in the Windows Event Logs.

Frequently asked questions

Additional solutions to common problems and the FAQ for the Nodinite Log4Net Appender exist in the Troubleshooting user guide.


Next step

Configuration
[Update][]
Log API

Prerequisites
Uninstall