Skip to content

Refactor cloud-agent module logs for Log4j2#8714

Merged
JoaoJandre merged 11 commits intoapache:mainfrom
scclouds:log4j2-refactor-cloud-agent-module
Apr 1, 2024
Merged

Refactor cloud-agent module logs for Log4j2#8714
JoaoJandre merged 11 commits intoapache:mainfrom
scclouds:log4j2-refactor-cloud-agent-module

Conversation

@KlausDornsbach
Copy link
Copy Markdown
Contributor

Description

With the new version of Log4j there is some space for improving log readability using the new features. This PR refactors the logs from the cloud-agent module.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

It was tested in a local lab:

  • I have done some operations on cloudstack to induce the generation of the logs
  • No problems or changes to the log output were found

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Feb 27, 2024

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 6.09756% with 77 lines in your changes are missing coverage. Please review.

Project coverage is 31.06%. Comparing base (e44c17e) to head (396034a).

Files Patch % Lines
agent/src/main/java/com/cloud/agent/Agent.java 0.00% 49 Missing ⚠️
...nt/resource/consoleproxy/ConsoleProxyResource.java 0.00% 17 Missing ⚠️
...gent/src/main/java/com/cloud/agent/AgentShell.java 16.66% 5 Missing ⚠️
...va/com/cloud/agent/dao/impl/PropertiesStorage.java 0.00% 3 Missing ⚠️
...rc/main/java/com/cloud/agent/mockvm/MockVmMgr.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8714      +/-   ##
============================================
+ Coverage     30.93%   31.06%   +0.12%     
- Complexity    33753    33909     +156     
============================================
  Files          5404     5404              
  Lines        380309   380289      -20     
  Branches      55507    55489      -18     
============================================
+ Hits         117658   118122     +464     
+ Misses       247041   246512     -529     
- Partials      15610    15655      +45     
Flag Coverage Δ
simulator-marvin-tests 24.79% <0.00%> (+0.23%) ⬆️
uitests 4.34% <ø> (ø)
unit-tests 16.88% <6.09%> (+<0.01%) ⬆️

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.

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

thanks for the effort @KlausDornsbach. Looks good to me, just one remark that actually is a bit out of scope but is touched upon in your change, so maybe we can add this easy win.

Comment thread agent/src/main/java/com/cloud/agent/Agent.java Outdated
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8808

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

Overall looks good, I've found one issue that should be fixed and some points that could be improved but are a little out of scope of this PR.

Comment thread agent/src/main/java/com/cloud/agent/Agent.java Outdated
Comment thread agent/src/main/java/com/cloud/agent/Agent.java Outdated
Comment thread agent/src/main/java/com/cloud/agent/Agent.java Outdated
Comment thread agent/src/main/java/com/cloud/agent/Agent.java Outdated
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 8843

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM

@JoaoJandre
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 8982

@DaanHoogland
Copy link
Copy Markdown
Contributor

@KlausDornsbach

13:59:26 [ERROR] /jenkins/workspace/acs-centos7-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.20.0.0-SNAPSHOT/server/src/main/java/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java:[420,12] error: cannot find symbol
13:59:26   symbol:   variable s_logger
13:59:26   location: class SnapshotSchedulerImpl

I can not find the reference to s_logger in SnapshotSchedulerImpl in main, so maybe rebase on main would solve the issue.

klaus.freitas.scclouds and others added 11 commits March 25, 2024 12:47
@KlausDornsbach KlausDornsbach force-pushed the log4j2-refactor-cloud-agent-module branch from a7605e3 to 396034a Compare March 25, 2024 15:48
@KlausDornsbach
Copy link
Copy Markdown
Contributor Author

Thanks for the heads up @DaanHoogland, hopefully issues are solved now.

@JoaoJandre
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9044

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test alma9 kvm-alma9

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-9623)
Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
Total time taken: 48862 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8714-t9623-kvm-alma9.zip
Smoke tests completed. 129 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@JoaoJandre
Copy link
Copy Markdown
Contributor

Merging based on approvals and CI result

@JoaoJandre JoaoJandre merged commit a0b642c into apache:main Apr 1, 2024
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 1, 2024

Awesome work, congrats on your first merged pull request!

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Apr 9, 2024
* Refactor cloud-agent module logs for Log4j2

* better log4j2 logs for cloud-agent module

* erasing commented lines

* erasing unused import

* fixing mistakes

* more log refactor

* fixing log refactor lambdas

* adding suggestions to log refactor

* Apply suggestions from code review

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>

* Update Agent.java

revert a lambda expression because log4j2 does not support a non lambda + lambda as parameters

* Update Agent.java

fixing little mistake

---------

Co-authored-by: klaus.freitas.scclouds <klaus.freitas@scclouds.com.br>
Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
@DaanHoogland DaanHoogland added this to the 4.20.0.0 milestone May 7, 2024
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.

4 participants