Categorygithub.com/Ajsalemo/go-logging-examples
modulepackage
0.0.0-20230311000247-73d17ce7cc2d
Repository: https://github.com/ajsalemo/go-logging-examples.git
Documentation: pkg.go.dev

# README

go-logging-examples

Various examples of logging to file and console

This repo shows basic examples of how to write to console, files, both file and console - with and without custom loggers - as well as third-party loggers.

Each folder matches a route to it's name that invokes the logger logic on said route.

How to run: Clone this repo and run go run . in the root of the project.

  • console: Maps to /logger/console and writes to console with the Go standard logger
  • customloggertoconsole: Maps to /logger/customloggertoconsole and writes to console with a custom logger using the Go standard logger
  • customloggertoconsoleandfile: Maps to /logger/customloggertoconsoleandfile and writes to a file and console with a custom logger using the Go standard logger
  • customloggertofile: Maps to /logger/customloggertofile and writes to a file with a custom logger using the Go standard logger
  • index: Maps to / - root path
  • logfile: Maps to /logger/logfile and writes to a file with the Go standard logger
  • logrus: Maps to /logger/logrus and writes to console with Logrus
  • zap: Maps to /logger/zap and writes to console with Zap
  • zerolog: Maps to /logger/zerolog and writes to console with Zerolog

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author