logr

module
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: Apache-2.0

README

logr is an open source logger and metric service.
Helps you debug and analyze performance of your features.
Get to know your application better with logr.

Demo

Logr

  • logs looks like in your Terminal
  • storing data in ClickHouse
  • transport data by WebSocket
  • Golang backend
  • Vue.js frontend
  • Authorization by GitHub

Usage

const { Logr } = require('logr-node-client');

const conf = new Logr({
    udp: ':7776',
    publicKey: 'MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAMg7IrMCAwEAAQ==',
    privateKey: 'MC0CAQACBQDIOyKzAgMBAAECBQCHaZwRAgMA0nkCAwDziwIDAL+xAgJMKwICGq0=',
});

const logr = conf.newLogger('hello.log');

logr.info('Hello, Logr!');

Requirements

  • Node.js v12
  • Npm v6
  • Golang v1.13
  • ClickHouse v20
  • Mysql v5.7

Build & Run service

Manual

  1. Clone repository:
    git clone --recurse-submodules https://github.com/504dev/logr.git && cd logr
  2. Init config.yml file:
    make config
  3. Fill config.yml, see Config section
  4. Creating databases in Clickhouse and Mysql
    clickhouse-client --query "CREATE DATABASE IF NOT EXISTS logrdb"
    mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS logrdb;"
    
  5. Build frontend:
    make front
  6. Run:
    make run
  7. Enjoy:
    http://localhost:7778/

Docker

  1. Clone repository:
    git clone --recurse-submodules https://github.com/504dev/logr.git && cd logr
  2. Generate .env file:
    make env
  3. Edit .env file with your favourite editor
  4. Generate .config file:
    make config
  5. Run:
    docker-compose up -d
  6. Enjoy:
    http://localhost:7778/

Config

bind:
  http: ":7778"
  udp: ":7776"
oauth:
  github:
    client_id: "9bd30997b0ee30997b0ee3"
    client_secret: "1f241d37d910b11f241d37d910b11f241d37d910b1"
    org: "504dev"
  jwt_secret: "jwt-secret"
clickhouse: "tcp://localhost:9000?database=logr&username=logr&password=logr"
mysql: "logr:logr@tcp(localhost:3306)/logr"
  • client_id and client_secret is Github App keys (optional. set empty, if not sure)
  • org is organization restriction (if set, only org members can authorize)
  • jwt_secret is random string (using to sign temporary authorization tokens)

Client libraries

Utils

Directories

Path Synopsis
cmd
models
log
ws

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL