gelf 0.1.2

The Graylog Extended Log Format for std.experimental.logger


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

gelf

Implementation of Graylog Extended Logging Format for std.experimental.logger.

Features

  • Small and flexible API
  • GrayLogger does not throw exceptions while it is sending a message
  • UDP, TCP, and HTTP transports are supproted

Examples

UDP

Compress c; // `null` value is for no compression
// c = new Compress;
// c = new Compress(HeaderFormat.gzip);
auto socket = new UdpSocket();
socket.connect(new InternetAddress("192.168.59.103", 12201));
// The last param is UDP chunk size. This is optional paramter with default value equals to 8192
sharedLog = new UdpGrayLogger(socket, c, "YourServiceName", LogLevel.all, 4096);

error("===== Error Information =====");

TCP

import std.typecons: Yes, No;
auto socket = new TcpSocket();
socket.connect(new InternetAddress("192.168.59.103", 12201));
// Defualt value for nullDelimeter is `Yes`.
// Newline delimiter would be used if nullDelimeter is `false`/`No`.
sharedLog = new TcpGrayLogger(socket, "YourServiceName", LogLevel.all, Yes.nullDelimeter);

error("===== Error Information =====");

HTTP

import std.net.curl: HTTP;
Compress c; // `null` value is for no compression
// c = new Compress;
// c = new Compress(HeaderFormat.gzip);
sharedLog = new HttpGrayLogger(HTTP("192.168.59.103:12201/gelf"), c, "YourServiceName", LogLevel.all);

error("===== Error Information =====");

Authors: Ilya Yaroshenko

Dependencies: none

Versions:
0.1.2 2016-Apr-01
0.1.1 2016-Apr-01
0.1.0 2016-Apr-01
~master 2017-Apr-21
Show all 4 versions
Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 52 downloads total