Skip to content

scepman/logtail-dotnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logtail .NET

.NET Standard 2.1 client for Logtail.com.

dotnet add package Logtail

Using with NLog

You can configure our NLog target in your nlog.config:

<?xml version="1.0" encoding="utf-8" ?>
<nlog
    xmlns="<http://www.nlog-project.org/schemas/NLog.xsd>"
    xsi:schemaLocation="NLog NLog.xsd"
    xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>">

  <extensions>
    <add assembly="Logtail" />
  </extensions>

  <targets>
    <target xsi:type="Logtail" name="logtail" sourceToken="YOUR_LOGTAIL_SOURCE_TOKEN"/>
  </targets>

  <rules>
    <logger name="*" minlevel="Info" writeTo="logtail" />
  </rules>

</nlog>

Then use your NLog logger anywhere in your app:

using System;
using NLog;

namespace YourApplication
{
    class Program
    {
        private static Logger logger = LogManager.GetCurrentClassLogger();

        static void Main(string[] args)
        {
            logger.Info("Hello World");
        }
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%