HTTP request logger for Golang

Overview

Horus 𓂀

horus-hero

Introduction

Horus is a request logger and viewer for Go. It allows developers log and view http requests made to their web application.

horus-big-brother

Installation

Run the following command to install Horus on your project:

go get github.com/ichtrojan/horus

Initiate horus

package main

import github.com/ichtrojan/horus

func main() {
    listener, err := horus.Init("mysql", horus.Config{
		DbName:    "{preferred_database_name}",
		DbHost:    "{preferred_database_host}",
		DbPssword: "{preferred_database_password}",
		DbPort:    "{preferred_database_port}",
		DbUser:    "{preferred_database_user}",
	})
}

NOTE
Supported database adapters include mysql and postgres

Serve dashboard (optional)

horus-message-received

...
if err := listener.Serve(":8081", "{preferred_password}")); err != nil {
	log.Fatal(err)
}
...

NOTE
Visit /horus on the port configured to view the dashboard

Usage

To enable horus to listen for requests, use the Watch middleware provided by horus on the endpoints you will like monitor.

...
http.HandleFunc("/", listener.Watch(func(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "application/json")

    response := map[string]string{"message": "Horus is live 👁"}

    _ = json.NewEncoder(w).Encode(response)
}))
...

You can explore the implementation in the example folder.

Built by

Issues
  • feat: optimize by connecting to db only once

    feat: optimize by connecting to db only once

    Every time the watch method is called, we make a connection to the DB, to reduce latency this PR moves the db connection to the init method and adds a Close method the user should defer in their application

    opened by phirmware 0
Releases(v1.1.0)
Owner
Michael Okoh
The Nothing
Michael Okoh
Logger - Simple logger without written with std pkg

Go-Logger Simple usage is: package main

MaskedTrench 2 Jan 2, 2022
Logger - A thin wrapper of uber-go/zap logger for personal project

a thin wraper of uber-go/zap logger for personal project 0. thanks uber-go/zap B

tsingson 0 May 2, 2022
Sugared logger for console with request id

?? zlog You don't know what it's like, you don't have a clue If you did you'd find yourselves doing the same thing too Sugared logger for console with

Zahid Altair 0 Sep 24, 2021
xlog is a logger for net/context aware HTTP applications

⚠️ Check zerolog, the successor of xlog. HTTP Handler Logger xlog is a logger for net/context aware HTTP applications. Unlike most loggers, xlog will

Olivier Poitrey 135 Nov 22, 2021
Dead simple, super fast, zero allocation and modular logger for Golang

Onelog Onelog is a dead simple but very efficient JSON logger. It is one of the fastest JSON logger out there. Also, it is one of the logger with the

Francois Parquet 401 Apr 5, 2022
A feature-rich and easy to use logger for golang

A feature-rich and easy to use logger for golang ?? Install ?? Common Logs lumber.Success() lumber.Info() lumber.Debug() lumber.Warning()

Matthew Gleich 48 May 10, 2022
🪵 A dead simple, pretty, and feature-rich logger for golang

?? lumber ?? A dead simple, pretty, and feature-rich logger for golang ?? Install ?? Logging Functions lumber.Success() lumber.Info() lumber.Debug() l

Matt Gleich 48 May 10, 2022
A simple and super power logger for golang

The most powerfull and faster logger for golang powered by DC ?? What is this? W

Teo 7 Jan 23, 2022
A project that adds color to golang's logger module

logger A project that adds color to golang's log module Installation go get github.com/christopher18/logger Usage // Import the module import "github

null 0 Dec 28, 2021
A Simple logger for golang

go-logger Installation go get github.com/mo-taufiq/go-logger Quickstart package main import ( gologger "github.com/mo-taufiq/go-logger" ) func main

Moh Taufiqur Rohman 1 Jan 15, 2022
Go-l3 - Lightweight Levelled Logger for Golang

Go-l3 - Lightweight Levelled Logger for Golang

nandlabs 1 Jan 20, 2022
A logger, for Go

Go-Log A logger, for Go! It's sort of log and code.google.com/p/log4go compatible, so in most cases can be used without any code changes. Breaking cha

Ian Kent 38 May 12, 2022
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Amanpreet Singh 275 Apr 27, 2022
Loggly Hooks for GO Logrus logger

Loggly Hooks for Logrus Usage package main import ( "github.com/sirupsen/logrus" "github.com/sebest/logrusly" ) var logglyToken string = "YOUR_LOG

Sebest 27 Jul 27, 2021
A 12-factor app logger built for performance and happy development

logxi log XI is a structured 12-factor app logger built for speed and happy development. Simpler. Sane no-configuration defaults out of the box. Faste

Mario Gutierrez 346 Apr 22, 2022
A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

SQLDB-Logger A logger for Go SQL database driver without modify existing *sql.DB stdlib usage. Colored console writer output above only for sample/dev

Sarjono Mukti Aji 217 May 22, 2022
Zero Allocation JSON Logger

Zero Allocation JSON Logger The zerolog package provides a fast and simple logger dedicated to JSON output. Zerolog's API is designed to provide both

Olivier Poitrey 6.3k May 14, 2022
A powerful zero-dependency json logger.

ZKits Logger Library About This package is a library of ZKits project. This is a zero-dependency standard JSON log library that supports structured JS

Qingshan Luo 15 Dec 31, 2021
Configurable Logger for Go

Timber! This is a logger implementation that supports multiple log levels, multiple output destinations with configurable formats and levels for each.

DeNA SF 67 Dec 27, 2021