vibe-json-log 0.1.2

A JSON based logger for vibe-core.


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:

vibe-json-log

A JSON based logger for vibe-core.

Usage

To use the logger in your vibe-core based project, simply register it as a logger:

import vibe.core.log : registerLogger;
import vibe_json_log.log : JSONLogger;

registerLogger(cast(shared) new JSONLogger());

The no argument constructor creates a JSONLogger that logs to stdout and stderr depending on the loglevel. You can log to specific files using the other overloads:

import std.stdio : File;
import vibe_json_log.log : JSONLogger;

new JSONLogger(File("path/to/infoFile.log", "ab"), File("path/to/errorFile.log", "ab"));

new JSONLogger("path/to/logFile.log");

Format

The format of the log messages is described in log-message.schema.json. Here is an example of how a log message could look like:

{
    "timestamp": "2019-06-17T23:47:42.6605845Z",
    "threadName": "main",
    "threadID": "A6A7AF69",
    "taskID": "Aud+-fin",
    "level": "TRACE",
    "file": "../../.dub/packages/vibe-core-1.6.2/vibe-core/source/vibe/core/sync.d",
    "line": 1047,
    "message": "emit shared done"
}

Acknowledgement

This project is heavily based on the FileLoger which is distributed as part of vibe-core. You can find the corresponding license here.

Authors:
  • Johannes Loher
Dependencies:
vibe-core
Versions:
0.1.2 2019-Jun-18
0.1.1 2019-Jun-18
0.1.0 2019-Jun-18
~master 2019-Jun-18
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 3 downloads this month

  • 22 downloads total

Score:
0.5
Short URL:
vibe-json-log.dub.pm