Skip to content

Commit

Permalink
chore: caddy: enable logging of static file requests (#36500)
Browse files Browse the repository at this point in the history
## Description
- Enable logs of static file requests in caddy.
- Skip logging for CSS and JS source map files. These files are
inconsequential for page rendering and therefore not worth tracking, as
they only pollute the log files.

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11016033178>
> Commit: 97cfe30
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11016033178&attempt=3"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 25 Sep 2024 05:08:51 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced logging configurations to improve performance by skipping
logs for health check requests and JavaScript map files.

- **Bug Fixes**
- Adjusted existing logging behavior for file handling to ensure more
accurate log processing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
dvj1988 authored Sep 25, 2024
1 parent 1996382 commit 4743e96
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,16 @@ parts.push(`
log {
output stdout
}
# skip logs for health check
skip_log /api/v1/health
# skip logs for sourcemap files
@source-map-files {
path_regexp ^.*\.(js|css)\.map$
}
skip_log @source-map-files
# The internal request ID header should never be accepted from an incoming request.
request_header -X-Appsmith-Request-Id
Expand Down Expand Up @@ -110,7 +118,6 @@ parts.push(`
@file file
handle @file {
import file_server
skip_log
}
handle /static/* {
Expand Down

0 comments on commit 4743e96

Please sign in to comment.