zhanbei / static-server

A static server in Go, supporting hosting static files in the no-trailing-slash version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The differences between the app logs and the Nginx logs.

zhanbei opened this issue · comments

Are there any differences between the app logs and the Nginx logs, are they reasonable, and how to make use of them?

There are reasonable differences, like:

  • Request Time Network
    • The request time, as well as the time consumed / performance, may differ due to the network latency.
  • Application Errors
    • The applications may have panics while the Nginx will take care of the rest.
  • Redirection
    • The redirection from the HTTP to HTTPS will make the Nginx logs more verbose.

while there are potential differences if being wrongly configured, like:

  • Log Format
  • Client IP
  • Timezone
  • Scopes of Logs
    • The sets of logs by Nginx tend to be larger than or equal to the sets of logs by applications since there are often one Nginx corresponding multiple services and even www directories with static files.
    • The Log Rotation strategy makes it a bit harder for scripts to investigate the differences.
  • HTTP Protocol
    • The protocols used by Nginx to reverse serve the requests may be different from the ones of the clients' side.

Being said, the HTTP Request ID should be better enabled and recorded, to compare the two sets of logs row by row.

Submit Often, and Enrich Later

With nearly one hour to compose and one hour to recover??? Is it reasonable?

  • Being efficient and productive as the goal, be cautious about the reinvention of articles.
  • Spend time read, summarize the conventions upon the immediate thoughts, and practice.

With great pains comes with great counterattacks.

The value here is to find the right patterns, which comforts the normal workflows.