Configuring NLOG 5 in kubernetes using splunk-connect in .net containers

Configmap in kubernetes

We are creating a simple configmap from an existing nlog.config file in kubernetes. The contents of your nlog.config should be configured as follows

Build a deploy file via kubectl

To create a deployable configmap from this nlog.config file you can simply use kubectl and the build in features to create a new config map:

The local nlog.config in your .net application

Your .net application should have a local nlog.config, which can be adjusted via environment variables. The local nlog.config is in my case pretty simple and just logging coloured strings to the console.

Deploying your app and mount the json logging nlog.config

Your deployment file for kubernetes just need to mount the configfile created earlier to the local filesystem of your app and set the environement variable “NLOG” to point to the mounted file.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store