Skip to content

feat: add logging#9

Merged
cbartz merged 3 commits intomainfrom
feat/log-requests
Oct 6, 2025
Merged

feat: add logging#9
cbartz merged 3 commits intomainfrom
feat/log-requests

Conversation

@cbartz
Copy link
Copy Markdown
Collaborator

@cbartz cbartz commented Oct 2, 2025

Overview

Add basic access logs

e.g.

2025/10/06 13:12:50 INFO 127.0.0.1:38634 - - [06/Oct/2025:13:12:50 +0200] "POST /webhook HTTP/1.1" 200 0 "curl/7.81.0"

Rationale

To help the operator understanding the deployment

Checklist

  • The PR is tagged with appropriate label (urgent, trivial, senior-review-required, documentation).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds basic access logging functionality to the webhook server to help operators understand deployment activity. The logging follows Apache Common Log Format, providing structured request information including IP address, timestamp, HTTP method, status code, and user agent.

  • Replaces direct http.Error calls with a new respondWithError function that includes logging
  • Adds access logging for both successful and error responses
  • Implements Apache-style log format with timestamp, request details, and response information

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread internal/webhook/server.go
Comment thread internal/webhook/server.go Outdated
Copy link
Copy Markdown
Collaborator

@javierdelapuente javierdelapuente left a comment

Choose a reason for hiding this comment

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

Looks good. Just if the file increase I would consider using a middleware to wrap the handler.

@cbartz cbartz merged commit 663963c into main Oct 6, 2025
9 checks passed
@cbartz cbartz deleted the feat/log-requests branch October 6, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants