Docs
Logging

Logging

Best practices for logging

Naming Consistency

For all logging statements we should apply the following:

  • url: The URL where the logging was run at
  • requestId: As a request comes in, it will be assigned a unique ID. This unique ID will follow the request through the application. This will help tie the different pieces of the request together.

Other common items

  • error: String representation of error
  • remoteAddr: For financial and authentication systems we should log the ip address

Security

We want to log the user's IP address, email, user id (if applicable) for the following:

  • Authentication
    • Login
    • Password Reset
    • Account Creation
  • Billing
    • Update account