跳到內容

Logging

本頁內容尚未翻譯。

Gin includes a built-in logger middleware that records details about each HTTP request. You can customize the log format, control output coloring, skip logging for specific paths, and define custom route log formats.

This section covers:

  • Writing logs to a file
  • Customizing log format
  • Skipping logs for specific paths or conditions
  • Controlling log output coloring
  • Avoiding logging of query strings
  • Defining custom route log formats