1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

smtp: Use zerolog hooks for warns/errors expvars #90

This commit is contained in:
James Hillyerd
2018-03-31 14:06:58 -07:00
parent 92f2da5025
commit e076f80416
3 changed files with 39 additions and 22 deletions

View File

@@ -113,7 +113,9 @@ func (s *Session) String() string {
* 5. Goto 2
*/
func (s *Server) startSession(id int, conn net.Conn) {
logger := log.With().Str("module", "smtp").Str("remote", conn.RemoteAddr().String()).
logger := log.Hook(logHook{}).With().
Str("module", "smtp").
Str("remote", conn.RemoteAddr().String()).
Int("session", id).Logger()
logger.Info().Msg("Starting SMTP session")
expConnectsCurrent.Add(1)