tsjl-node

1.1.1 • Public • Published

Tolley's Simple JSON Logger - Node.JS

TSJL is a logger, that logs JSON, and is simple to use; hence the name.

It outputs a JSON object that looks like this in the logfile:

{
    "date": "2021-10-08T11:50:10.674Z",
    "level": "info",
    "appName": "discord-bot",
    "subprocess": "mongodb-handler",
    "message":"Connected to Server!",
    "extra": {
        "ip": "127.0.0.1",
        "user":"tolley"
        }
    }

but like this in the console

[2021-10-08 12:50:10 GMT+01] [discord-bot.mongodb-handler] [Info] Connected to Server!

Options:

let logger = new tsjl.Logger("foo", "bar", {
    //idk
    stdout: {
        enable: false
    },
    //webhook link where to send the embed containing the logged information
    webhook: {
        url: "https://discord.com/api/webhooks/123456789/abcdefghilmnopqrstvz" 
    }
    //idk
    file: [
        {
            enable: true,
            json: false,
            path: "./human.log"
        }
    ]
});

Readme

Keywords

none

Package Sidebar

Install

npm i tsjl-node

Weekly Downloads

10

Version

1.1.1

License

MIT

Unpacked Size

14.6 kB

Total Files

5

Last publish

Collaborators

  • tolleylikesrice