From 4743e96846ee39adcf049f99b9b95ac75f1de85d Mon Sep 17 00:00:00 2001 From: Diljit Date: Wed, 25 Sep 2024 11:01:18 +0530 Subject: [PATCH] chore: caddy: enable logging of static file requests (#36500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 97cfe307355f159a9cb80295fb566c406ffc056a > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Wed, 25 Sep 2024 05:08:51 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## 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. --- deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs index b5103011c4..f265b2da71 100644 --- a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs +++ b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs @@ -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 @@ -110,7 +118,6 @@ parts.push(` @file file handle @file { import file_server - skip_log } handle /static/* {