vibed-elastic-logger ~master
Vibe.d logger implementation for ElasticSearch
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
vibed-elastic-logger
ElasticSearch logger implementation for Vibe.d
Documentation
Example
void main()
{
import vibe.core.log : logInfo, registerLogger;
import vibe_elastic_logger : ElasticInfo, ElasticLogger;
import core.time : dur;
string generateIndex() @safe
{
import std.datetime : Clock;
import std.format : format;
auto now = Clock.currTime();
return format!"vibe_logger_test_%04d_%02d"(now.year, now.month);
}
ElasticInfo info;
info.hostName = "localhost";
info.typeName = "messages";
info.portNumber = 9200;
auto l = cast(shared) new ElasticLogger(info, &generateIndex, dur!"seconds"(5), 30);
registerLogger(l);
}
Data Format
Here's an example of what a log message will look like in Elastic:
...
{
"_index": "vibe_logger_test_2018_02",
"_type": "messages",
"_id": "AWFtxExgJY-mBsy0A_50",
"_score": 1,
"_source": {
"message": "Main thread exiting",
"module": "",
"function": "",
"file": "../../.dub/packages/vibe-d-0.8.2/vibe-d/core/vibe/core/core.d",
"line": "1781",
"level": "diagnostic",
"fiberID": "0",
"time": "2018-02-07T00:57:16.6429738Z"
}
},
...
- Registered by Brian Schott
- ~master released 6 years ago
- economicmodeling/vibed-elastic-logger
- MIT
- Copyright © 2018, Emsi
- Authors:
- Sub packages:
- vibed-elastic-logger:test
- Dependencies:
- vibe-d
- Versions:
-
1.0.0 2018-Feb-08 ~master 2018-Feb-08 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
103 downloads total
-
- Score:
- 0.5
- Short URL:
- vibed-elastic-logger.dub.pm