Byte-Cats / microman

Minimal Go Backend Starter Kit without frameworks
MIT License
1 stars 1 forks source link

Logging System #28

Closed 4cecoder closed 1 year ago

Yuno-obsessed commented 1 year ago

What do you mean by logging system? Tell the basic idea of what you want to see in the logging system, so we can discuss how to implement it in the best way possible 🔥

4cecoder commented 1 year ago

logging responses and requests???

go docs from https://github.com/gorilla/handlers/ package

writing logging middleware from scratch in go

4cecoder commented 1 year ago

just log the basics of the http requests into a nice json file in microman/log/logging.json

would require appending to existing json

create function that lets the user control the write to logging.json frequency by seconds add LOG_SAVE_FREQUENCY_IN_SECONDS to .env if LOG_SAVE_FREQUENCY_IN_SECONDS == 0 then disable logging

that way as a microman user i could choose what to do with it

possibly add an endpoint to display current log baseURL + "/api/log"

this package seems to have some cool json logging implementation out of the box for http requests

https://github.com/gilcrest/httplog

if this is implemented it could possibly solve logging for us easily

that way microman devs don't have to worry about what to log... just implement the middle-ware and figure out how to it to add to a saved file

4cecoder commented 1 year ago

https://www.youtube.com/watch?v=Gp0-7oVOtPw please use this fluentd tutorial @Yuno-obsessed and work with @GNRain to implement our logging system

if there is any code problems you are stuck on create a new issue and assign it to @4cecoder and i'll code it for @Yuno-obsessed :)

4cecoder commented 1 year ago

so @Yuno-obsessed just simply append each console output line (converted to json) to the file log/logging.json

and @GNRain @4cecoder will log the rest (networking and container info) by using fluentd + devops strategies

4cecoder commented 1 year ago

good engineering is simple