Flume from C#

Apache Flume is a distributed, reliable, and available service for efficiently collecting, aggregating, and moving large amounts of log data.

Flume has an appender for log4j, but no support for log4net or NLog was provided.  I created a opensource appenders on GitHub.

Both of them are pretty straight forward to use with two steps:

1. Install the Nuget package


Install-Package DotNetFlumeNG.Client.NLog

2. Configure the appender

<pre><code><configuration>

  <configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
  </configSections>

  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <extensions>
      <add assembly="DotNetFlumeNG.Client.NLog" />
    </extensions>
    <targets>
      <target name="a1" type="Flume" host="yourflumeserver" port="yourflumeport" />
    </targets>
    <rules>
      <logger name="*" minLevel="Info" appendTo="a1" />
    </rules>
  </nlog>

</configuration>
</code></pre>
<code> </code>

3. That’s it!

All existing logging code will now be logged to your existing flume services!

Advertisements
Aside | This entry was posted in .Net, C# and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s