Skip to content

Commit

Permalink
Use time.Time for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Aug 16, 2024
1 parent 24ee5bc commit 7502450
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sshmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ func (s *Server) ListenAddr(address string) error {
logger = slog.New(slog.NewJSONHandler(*s.LogWriter, nil))
}
logger = logger.With(
slog.Int64("connect_time", time.Now().Unix()),
slog.Time("connect_time", time.Now()),
slog.String("remote_ip", conn.RemoteAddr().String()),
slog.String("client_type", "SSH"),
)
defer func() {
session.Close()
logger.Info("SSH proxy session", slog.Int64("disconnect_time", time.Now().Unix()))
logger.Info("SSH proxy session", slog.Time("disconnect_time", time.Now()))
}()
attrs, err := s.RunPipeSession(session)
if err != nil {
Expand Down

0 comments on commit 7502450

Please sign in to comment.