Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A structured logger for Fluentd (D)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 html
Octocat-spinner-32 src
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.markdown
Octocat-spinner-32 posix.mak
README.markdown

Fluent logger

A structured event logger for Fluent

Usage

struct Event
{
    string text = "This is D";
    long   id   = 0;
}

// ...
import fluent.logger;

// Create a configuration
FluentLogger.Configuration conf;

// Create a logger with tag prefix and configuration
auto logger = new FluentLogger("app", conf);

// Write Event object with "test" tag to Fluentd 
logger.post("test", Event());

In this result, Fluentd accepts {"text":"This is D","id":0} at "app.test" tag.

Sharing logger

Currently, FluentLogger is not marked as shared. So, if you share a logger object accross threads, please use __gshared.

Build

% make -f posix.make

TODO

  • std.log support after Phobos accepts std.log
  • Add some qualifiers (@safe, nothrow, shared, etc..)
  • Windows support

Link

Copyright

Author Masahiro Nakagawa
Copyright Copyright (c) 2012- Masahiro Nakagawa
License Apache License, Version 2.0
Something went wrong with that request. Please try again.