Skip to content

Rationale behind the UUID in logging messages? #284

@Necoro

Description

@Necoro

When relaying a mail, the code logs a message about it -- which includes a random UUID:

smtprelay/main.go

Lines 176 to 180 in ccb70f5

logger := log.With().
Str("from", env.Sender).
Strs("to", env.Recipients).
Str("peer", peerIP).
Str("uuid", generateUUID()).

What is the rationale here?

  • The UUID is not connected to the mail itself (so it would print out a different UUID if it would come through here again for the same mail).
  • Thus, there is also nothing to link back from UUID to mail (for tracing, for instance)
  • This is the sole location where a UUID is used
  • A whole dependency (albeit small) has been added just for this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions