All Projects → dustinchilson → NLog.Targets.GraylogHttp

dustinchilson / NLog.Targets.GraylogHttp

Licence: Apache-2.0 license
NLog target that pushes log messages to Graylog using the Http input.

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to NLog.Targets.GraylogHttp

Nlog
NLog - Advanced and Structured Logging for Various .NET Platforms
Stars: ✭ 5,296 (+31052.94%)
Mutual labels:  netstandard, nlog
logback-gelf-appender
Logback appender that sends GELF messages
Stars: ✭ 38 (+123.53%)
Mutual labels:  gelf, graylog
logspout-gelf
Logspout with GELF adapter
Stars: ✭ 16 (-5.88%)
Mutual labels:  gelf, graylog
Nlog.extensions.logging
NLog Provider for Microsoft.Extensions.Logging for .NET Standard libraries and .NET Core applications
Stars: ✭ 323 (+1800%)
Mutual labels:  netstandard, nlog
Quicklogger
Library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Stars: ✭ 137 (+705.88%)
Mutual labels:  graylog, netstandard
gelf-extensions-logging
GELF provider for Microsoft.Extensions.Logging
Stars: ✭ 81 (+376.47%)
Mutual labels:  gelf, graylog
Graylog2 Server
Free and open source log management
Stars: ✭ 5,952 (+34911.76%)
Mutual labels:  gelf, graylog
aspnetcore-authentication-apikey
Easy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, Authorization Header, QueryParams or HeaderOrQueryParams.
Stars: ✭ 215 (+1164.71%)
Mutual labels:  netstandard
graylog-plugin-oauth2
Oauth2 plugin for graylog project
Stars: ✭ 16 (-5.88%)
Mutual labels:  graylog
resharper-structured-logging
An extension for ReSharper and Rider that highlights structured logging templates and contains some useful analyzers
Stars: ✭ 117 (+588.24%)
Mutual labels:  nlog
NLog.Targets.Syslog
A Syslog server target for NLog
Stars: ✭ 63 (+270.59%)
Mutual labels:  nlog
Autofac.Extras.NLog
An Autofac module to integrate Autofac and NLog, it supports both constructor and property injection.
Stars: ✭ 48 (+182.35%)
Mutual labels:  nlog
terraform-provider-graylog
Terraform Provider for Graylog
Stars: ✭ 21 (+23.53%)
Mutual labels:  graylog
graylog-plugin-netflow
[DEPRECATED] Graylog NetFlow plugin
Stars: ✭ 35 (+105.88%)
Mutual labels:  graylog
NETProvider
Firebird ADO.NET Data Provider
Stars: ✭ 113 (+564.71%)
Mutual labels:  netstandard
graylog-plugin-collector
Collector plugin for Graylog
Stars: ✭ 13 (-23.53%)
Mutual labels:  graylog
Vulkan.NET
This repository contains low-level bindings for Vulkan used in Evergine.
Stars: ✭ 119 (+600%)
Mutual labels:  netstandard
EPPlus.Core.Extensions
An extensions library for EPPlus package to generate and manipulate Excel files easily.
Stars: ✭ 66 (+288.24%)
Mutual labels:  netstandard
Kendo.DynamicLinqCore
KendoNET.DynamicLinq implements server paging, filtering, sorting, grouping, and aggregating to Kendo UI via Dynamic Linq for .Net Core App(1.x ~ 3.x).
Stars: ✭ 36 (+111.76%)
Mutual labels:  netstandard
paseto-dotnet
🔑 Paseto.NET, a Paseto (Platform-Agnostic Security Tokens) implementation for .NET
Stars: ✭ 67 (+294.12%)
Mutual labels:  netstandard

NLog.Targets.GraylogHttp

Codacy Badge Apache 2.0 licensed NuGet

This is a custom target for NLog that pushes log messages to Graylog using the Http input.

This library was influenced by EasyGelf

Installation

This library is packaged as a nuget package available here

Install-Package NLog.Targets.GraylogHttp

NetStandard, .Net Core 2.1-5.0, .Net Framework 4.5

This library runs under netstandard 1.3 and fully supports .Net Core 2.1-3.1, .Net 5.0, and .Net Framework 4.5+

Usage

Add or modify your NLog Configuration to add the new target and Extension Assembly.

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <extensions>
    <add assembly="NLog.Targets.GraylogHttp"/>
  </extensions>
  <targets>
    <target name="graylog"
              xsi:type="GraylogHttp"
              facility="[FACILITY]"
              graylogServer="[SERVER]"
              graylogPort="[PORT]">
        <!-- Location information. -->
        <parameter name="source_method" layout="${callsite}" />
        <parameter name="source_line" layout="${callsite-linenumber}" />

        <parameter name="test_prop" layout="${event-context:item=test_prop}" />
      </target>
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" appendTo="graylog"/>
  </rules>
</nlog>
  • graylogServer - REQUIRED - URI formatted address of your server (e.g. http://192.168.1.2, http://example.com, https://graylog.example.com:3030)
  • graylogPort - OPTIONAL - server port, normally specified by Input in Graylog, Can also be specified in the server
  • facility - OPTIONAL - variable could be used to identify your application, library, etc.

Simple Logging

var logger = LogManager.GetCurrentClassLogger();
logger.Trace("String");
logger.Debug("String");
logger.Warn("String");
logger.Error("String");
logger.Fatal("String");

Advanced Properties

var logger = LogManager.GetCurrentClassLogger();
var e = new LogEventInfo(LogLevel.Fatal, "Test", "Test Message");
e.Properties["test_prop"] = "test property";
logger.Log(e);

Note

In order to receive logs in your Graylog server, make sure you create Input for your application mentioned in Getting Started guide under Collect Messages link.

References

Gelf Spec

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].