Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Common Log Format for logging output #795

Closed
wants to merge 1 commit into from

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 1, 2022

Use Combined Log Format, so package-registry logs can be parsed with the
same tools that can be used to parse logs of common web servers such as
Apache or nginx.

This log format is not much more verbose and includes additional information:

  • Timezone in the timestamp.
  • HTTP method, HTTP version, status code and response size.
  • Referer (when available).
  • User agent (when available).

This changes the log format from:

2022/03/01 10:12:31 source.ip: 127.0.0.1:42334, url.original: /
2022/03/01 10:12:38 source.ip: 127.0.0.1:42342, url.original: /search

To:

127.0.0.1 - - [01/Mar/2022:10:28:28 +0100] "GET / HTTP/1.1" 200 71 "" "curl/7.58.0"
127.0.0.1 - - [01/Mar/2022:10:28:57 +0100] "GET /search HTTP/1.1" 200 7912 "" "curl/7.58.0"

Use Common Log Format, so package-registry logs can be parsed with the
same tools that can be used to parse logs of common web servers such as
Apache or nginx.
@jsoriano jsoriano requested a review from a team March 1, 2022 09:42
@jsoriano jsoriano self-assigned this Mar 1, 2022
@elasticmachine
Copy link

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-01T09:42:54.678+0000

  • Duration: 5 min 38 sec

Test stats 🧪

Test Results
Failed 0
Passed 142
Skipped 0
Total 142

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it isn't on purpose. EPR logs on the infra side might be configured to process them this way.

@mtojek mtojek requested a review from ruflin March 1, 2022 10:14
@jsoriano
Copy link
Member Author

jsoriano commented Mar 1, 2022

Discussed offline with @ruflin, lets move to JSON ECS logs so no ingest pipeline is needed for ingestion in ES.

@jsoriano jsoriano closed this Mar 1, 2022
@jsoriano jsoriano mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants