Giter VIP home page Giter VIP logo

sand-castle-logger's Introduction

Sand Castle Logger

About

Sand castle logger is a simple realtime logger for your applications.

How it works:

  1. Open the dashboard on your browser:
    open-browser
  1. Send a request to the api:
POST http://localhost:3009/api/log/default
Body (application/json)
{
  "metadata": {
    "title": "Api url: /api/users/test",
    "color": "#FF4A1C",
    "icon": "fa-bug"
  },
  "body": {
    "error": "internal_error",
    "error_description": "unable to connect to database."
  }
}
  1. View the log appears on dashboard:
    dashboard-with-log

And that's it =).

Install and Run

We strongly recommend you to use Docker to avoid node version errors.

NodeJS

  • Clone this repository
  • Run npm install
  • Run npm start
  • Open http://localhost:3009 on your browser

Docker

  • Clone this repository
  • Run make run
  • Open http://localhost:3009 on your browser

Available commands:

  • make run: start the service
  • make run-with-logs: start the service and keep console logs
  • make down: stop the service

Logging

Chose your dashboard

After you install and open dashboard on your browser, you now can send logs to it.

When you open the dashboard, realize the token param on url: http://localhost:3009/?&t=default.

The t=default is customizable. You can set new value like http://localhost:3009/?&t=potato. It allow you to have multiple dashboards listening different namespace logs.

The name of this parameter is namespace token.

Send logs to api

After you chose your dashboard (or chose to use default), just send a POST request to http://localhost:3009/api/log/{namespace token}.

The body of the request must be:

{
    "metadata": {
        "title": "this is my title",

        "color": "#FFD5FF",
        "icon": "fa-bug",
        "uuid": "this_is_the_id_1"
    },
    "body": {}
}

When:

  • metadata.
    • title: the title of the log.
    • color (optional): color of the log (string, default=gray, accepts any that works with css).
    • icon (optional): any Font-Awesome icon.
    • uuid (optional): some id to let you identify your log.
  • body: any json object you want to log.

Ex:
Dashboard URL: http://localhost:3009/?&t=my-awesome-app

API Request:
POST http://localhost:3009/api/log/my-awesome-app

{
    "metadata": {
        "title": "PUT /api/users",
        "color": "#63C132",
        "icon": "fa-check-circle"
    },
    "body": {
        "message": "user saved!"
    }
}

Will reproduce:

log anathomy

"Advanced"

If you want, take a look in Advanced Options

Thanks To

Icon:

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Release Notes

Take a look

sand-castle-logger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pauladiniz

sand-castle-logger's Issues

feature: save logs

First of all, awesome project. Any plans on saving logs for future reviews or something like that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.