Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
/ log Public archive

⭐️ This is super simple REAL-TIME log (logger for logging logs). I've built this tool for debug purposes. The main aim of the project - just show to user logs published from any application layer.

License

Notifications You must be signed in to change notification settings

cn0047/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

42c1d2d · Jan 5, 2022
Oct 12, 2018
Aug 7, 2020
Jul 30, 2018
Mar 25, 2018
Mar 30, 2018
Jan 25, 2018
Oct 12, 2017
Sep 21, 2018
Oct 12, 2017
Jan 5, 2022
Oct 1, 2018
Oct 12, 2018
Jan 30, 2018

Repository files navigation

This is simple REAL-TIME log.

Build Status Scrutinizer Code Quality Coverage Status Maintainability PyPI PRs Welcome

Demo: how to use REAL-TIME log

Just open main page obtain your unique streamId (you will be redirected) or open certain stream (specify streamId in url like: https://realtimelog.herokuapp.com/test) and start listen you real time logs!!!

Under the hood, this log works with WebSockets so you will see logs immediately in your browser!

With the purpose to post something in your log stream use any code from examples below.

JavaScript:

fetch('https://realtimelog.herokuapp.com/test', {
  method: 'post', headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({code: 200, status: 'OK'})
});

NodeJS:

const r = require('https').request({
  host: 'realtimelog.herokuapp.com',
  path: '/test',
  method: 'POST',
  headers: {'Content-Type': 'application/json'}
});
r.write(JSON.stringify({code: 200, status: 'OK'}));
r.end();

Go:

import (
  "bytes"
  "encoding/json"
  "net/http"
)
j, _ := json.Marshal(map[string]string{"code": "200", "status": "OK"})
http.Post("https://realtimelog.herokuapp.com/test", "application/json", bytes.NewBuffer(j))

PHP:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://realtimelog.herokuapp.com/test');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['code' => 200, 'status' => 'OK']));
curl_exec($ch);
// OR
exec("curl -s https://realtimelog.herokuapp.com/test -H 'Content-Type: application/json' -d '".json_encode(['code' => 200])."'");

Python:

import requests
import json
requests.post(
  'https://realtimelog.herokuapp.com/test',
  data=json.dumps({'code': 200, 'status': 'OK'}),
  headers={'Content-Type': 'application/json'},
)

Bash:

curl -XPOST 'https://realtimelog.herokuapp.com/test' \
-H 'Content-Type: application/json' -d '{"code": 200, "status": "OK"}'
// OR
["sh", "-c", "curl -XPOST 'https://realtimelog.herokuapp.com:443/test' -H 'Content-Type: application/json' -d '{\"code\": 200}'"]

Sponsors

JetBrains