mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 12:55:54 +03:00
[PR #15] [MERGED] Add structured logging via logrus #59
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/smtprelay#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/decke/smtprelay/pull/15
Author: @JonathonReinhart
Created: 3/13/2021
Status: ✅ Merged
Merged: 3/13/2021
Merged by: @decke
Base:
master← Head:structured-logging📝 Commits (3)
34cb47cImplement structured logs using logrus095fba1Change default logfile to empty string (meaning stderr)9921b38Explicitly configure default logfile for stderr📊 Changes
6 files changed (+185 additions, -40 deletions)
View changed files
📝
config.go(+6 -1)📝
go.mod(+2 -0)📝
go.sum(+11 -0)➕
logger.go(+60 -0)📝
main.go(+98 -37)📝
smtprelay.ini(+8 -2)📄 Description
This adds structured logging using
logrus.This PR is a result of discussions on #13 and is based loosely on grafana/smtprelay#10.
This adds two new config options to the INI file:
log_formatwhich can be one of:default-- The defaultlogrusformat, but with full timestamps, similar to the previous output:plain-- The defaultlogrusformat, but with no timestamps (useful for running under Systemd)json-- JSON formatting with RFC3339Nano timestamp format:log_level-- The logging level; defaults to "info" (can be panic, fatal, error, warn, info, debug, trace)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.