Skip to content

create rotate file on the fly for access.log - #9324

Draft
DaanHoogland wants to merge 4 commits into
apache:mainfrom
shapeblue:ghi3443-rotateAccessLog
Draft

create rotate file on the fly for access.log#9324
DaanHoogland wants to merge 4 commits into
apache:mainfrom
shapeblue:ghi3443-rotateAccessLog

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Comment thread client/src/main/java/org/apache/cloudstack/ServerDaemon.java Outdated
Comment thread client/src/main/java/org/apache/cloudstack/ServerDaemon.java Outdated
@codecov

codecov Bot commented Jul 1, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.66%. Comparing base (b0d74fe) to head (78a578f).
⚠️ Report is 51 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (b0d74fe) and HEAD (78a578f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (b0d74fe) HEAD (78a578f)
unittests 1 0
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #9324       +/-   ##
============================================
- Coverage     17.57%   3.66%   -13.91%     
============================================
  Files          5913     445     -5468     
  Lines        529428   38541   -490887     
  Branches      64677    7265    -57412     
============================================
- Hits          93022    1413    -91609     
+ Misses       425944   36961   -388983     
+ Partials      10462     167    -10295     
Flag Coverage Δ
uitests 3.50% <ø> (-0.09%) ⬇️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
DaanHoogland force-pushed the ghi3443-rotateAccessLog branch from c300793 to f0b45e5 Compare October 15, 2025 11:37
@DaanHoogland
DaanHoogland force-pushed the ghi3443-rotateAccessLog branch from f0b45e5 to 78a578f Compare December 8, 2025 15:12
@DaanHoogland DaanHoogland reopened this Dec 23, 2025
@DaanHoogland
DaanHoogland force-pushed the ghi3443-rotateAccessLog branch from 78a578f to ff27a44 Compare December 23, 2025 19:58
@weizhouapache weizhouapache added this to the 4.24.0 milestone Jun 29, 2026
@nvazquez

Copy link
Copy Markdown
Contributor

Hi @DaanHoogland is this PR still in progress?

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@nvazquez , it just needs some validation, but should be ready. Outcome of validation might mean adjustment for different platforms, hence it is still in draft.

@DaanHoogland
DaanHoogland requested review from NuxRo and ingox and a lite review from Copilot August 13, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 attempts to ensure the server’s access.log is rotated by generating a logrotate configuration file during embedded server startup (when the Jetty request log is created).

Changes:

  • Adds runtime creation of a logrotate config targeting the configured access log file.
  • Introduces filesystem write logic under /etc/logrotate.d from ServerDaemon#createRequestLog().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +352 to +359
try {
FileWriter fw = new FileWriter(rotateConfigFile);
fw.write(fileContents);
fw.close();
} catch (IOException e) {
// log but continue without rotate (for now)
LOG.warn("no way to rotate access log, continuing as is");
}
Comment on lines +349 to +350
+ " create 0644 cloud cloud"
+ "}";
Comment on lines +341 to +343
private void createRotateFile(File logPath) {
String rotatefile = "/etc/logrotate.d/access";
String fileContents = logPath.getAbsolutePath() + " {\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants