log4net.Appender.SocketAppender 1.0.1

Package Description

Install-Package log4net.Appender.SocketAppender -Version 1.0.1
dotnet add package log4net.Appender.SocketAppender --version 1.0.1
<PackageReference Include="log4net.Appender.SocketAppender" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add log4net.Appender.SocketAppender --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SocketAppender Readme

Config in code:
log4net.GlobalContext.Properties[&quot;HostIP&quot;] = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()).FirstOrDefault(a =&gt; a.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToString();
log4net.GlobalContext.Properties[&quot;Version&quot;] = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString(4);
log4net.GlobalContext.Properties[&quot;AppName&quot;] = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
log4net.GlobalContext.Properties[&quot;AppFullName&quot;] = Assembly.GetEntryAssembly().GetCustomAttribute&lt;AssemblyDescriptionAttribute&gt;()?.Description;

Config in Xml

<appender name="SocketAppender" type="log4net.Appender.SocketAppender,log4net.Appender.SocketAppender"> <RemoteAddress value="127.0.0.1" /> <RemotePort value="5001" /> <AddressFamily value="InterNetwork" /> <SocketType value="Dgram" /> <ProtocolType value="Udp" />
&lt;ConAttemptsCount value=&quot;5&quot; /&gt;
&lt;ConAttemptsWaitingTimeMilliSeconds value=&quot;3000&quot; /&gt;
&lt;UseThreadPoolQueue value=&quot;true&quot; /&gt;
&lt;layout type=&quot;log4net.Layout.PatternLayout, log4net&quot;&gt;
&lt;conversionPattern value=&quot;{&amp;quot;LogType&amp;quot;:&amp;quot;IoTHub.Log&amp;quot;,&amp;quot;AppName&amp;quot;:&amp;quot;%property{AppName}&amp;quot;,&amp;quot;AppFullName&amp;quot;:&amp;quot;%property{AppFullName}&amp;quot;,&amp;quot;Version&amp;quot;:&amp;quot;%property{Version}&amp;quot;&amp;quot;host&amp;quot;:&amp;quot;%property{HostIP}&amp;quot;,&amp;quot;LogLevel&amp;quot;:&amp;quot;%level&amp;quot;,&amp;quot;@timestamp&amp;quot;:&amp;quot;%date{ISO8601}&amp;quot;,&amp;quot;Logger&amp;quot;:&amp;quot;%logger&amp;quot;,&amp;quot;message&amp;quot;:&amp;quot;%message&amp;quot;}&quot; /&gt;

&lt;/layout&gt; </appender>

SocketAppender Readme

Config in code:
log4net.GlobalContext.Properties[&quot;HostIP&quot;] = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()).FirstOrDefault(a =&gt; a.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToString();
log4net.GlobalContext.Properties[&quot;Version&quot;] = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString(4);
log4net.GlobalContext.Properties[&quot;AppName&quot;] = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
log4net.GlobalContext.Properties[&quot;AppFullName&quot;] = Assembly.GetEntryAssembly().GetCustomAttribute&lt;AssemblyDescriptionAttribute&gt;()?.Description;

Config in Xml

<appender name="SocketAppender" type="log4net.Appender.SocketAppender,log4net.Appender.SocketAppender"> <RemoteAddress value="127.0.0.1" /> <RemotePort value="5001" /> <AddressFamily value="InterNetwork" /> <SocketType value="Dgram" /> <ProtocolType value="Udp" />
&lt;ConAttemptsCount value=&quot;5&quot; /&gt;
&lt;ConAttemptsWaitingTimeMilliSeconds value=&quot;3000&quot; /&gt;
&lt;UseThreadPoolQueue value=&quot;true&quot; /&gt;
&lt;layout type=&quot;log4net.Layout.PatternLayout, log4net&quot;&gt;
&lt;conversionPattern value=&quot;{&amp;quot;LogType&amp;quot;:&amp;quot;IoTHub.Log&amp;quot;,&amp;quot;AppName&amp;quot;:&amp;quot;%property{AppName}&amp;quot;,&amp;quot;AppFullName&amp;quot;:&amp;quot;%property{AppFullName}&amp;quot;,&amp;quot;Version&amp;quot;:&amp;quot;%property{Version}&amp;quot;&amp;quot;host&amp;quot;:&amp;quot;%property{HostIP}&amp;quot;,&amp;quot;LogLevel&amp;quot;:&amp;quot;%level&amp;quot;,&amp;quot;@timestamp&amp;quot;:&amp;quot;%date{ISO8601}&amp;quot;,&amp;quot;Logger&amp;quot;:&amp;quot;%logger&amp;quot;,&amp;quot;message&amp;quot;:&amp;quot;%message&amp;quot;}&quot; /&gt;

&lt;/layout&gt; </appender>

  • .NETCoreApp 2.1

  • .NETFramework 2.0

  • .NETFramework 4.0

  • .NETFramework 4.5.2

  • .NETFramework 4.6

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 161 10/21/2018
1.0.0 116 9/29/2018