FluentD Logging with .Net Core


You can install the NLog plugin to logging to a Fluentd node.  Fluentd is a unified logging layer and if you're wondering if we're talking about the same logger, check it out here. There is a difference between fluentd and fluentbit. Fluentd is targeted for servers with larger processing capacity while fluentbt is for IOT devices with small memory footprint.


Getting your project ready with the following nuget

Install-Package NLog.Targets.Fluentd -Version 1.0.4

Install-Package NLog -Version 2.1.0

Install-Package System.Configuration.ConfigurationManager -Version 4.4.1

Setting up Fluentd Docker


This is the docker command to setup Fluentd as an endpoint to gather all your log.


docker run -d -p 24224:24224 -p 24224:24224/udp -v /data:/fluentd/log fluent/fluentd


This will start your docker container with fluentd.


Then we will use the following code to write to docker container :-







You can see your log as shown below when you connect to your docker container.








Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm