cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Log4j2 refactor cloud api module

Open KlausDornsbach opened this issue 2 years ago • 25 comments

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-api 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)
  • [X] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [ ] build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [X] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

How Has This Been Tested?

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

KlausDornsbach avatar Feb 29 '24 13:02 KlausDornsbach

Codecov Report

Attention: Patch coverage is 18.18182% with 54 lines in your changes missing coverage. Please review.

Project coverage is 15.55%. Comparing base (b215abc) to head (7e36519). Report is 298 commits behind head on main.

Files with missing lines Patch % Lines
...in/java/com/cloud/agent/api/storage/OVFHelper.java 16.66% 15 Missing :warning:
...k/api/command/user/template/CreateTemplateCmd.java 0.00% 4 Missing :warning:
...i/command/admin/vm/ImportUnmanagedInstanceCmd.java 0.00% 3 Missing :warning:
...he/cloudstack/api/command/user/vm/DeployVMCmd.java 0.00% 3 Missing :warning:
...in/java/com/cloud/agent/api/storage/OVFParser.java 0.00% 2 Missing :warning:
...and/user/firewall/CreateEgressFirewallRuleCmd.java 0.00% 2 Missing :warning:
...loadbalancer/ListLoadBalancerRuleInstancesCmd.java 0.00% 2 Missing :warning:
...user/snapshot/CreateSnapshotFromVMSnapshotCmd.java 0.00% 2 Missing :warning:
...dstack/api/command/user/vm/ResetVMPasswordCmd.java 0.00% 2 Missing :warning:
...java/org/apache/cloudstack/context/LogContext.java 0.00% 2 Missing :warning:
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##               main    #8728    +/-   ##
==========================================
  Coverage     15.55%   15.55%            
- Complexity    12010    12012     +2     
==========================================
  Files          5500     5500            
  Lines        481850   481831    -19     
  Branches      61843    60948   -895     
==========================================
+ Hits          74935    74944     +9     
+ Misses       398628   398602    -26     
+ Partials       8287     8285     -2     
Flag Coverage Δ
uitests 4.17% <ø> (ø)
unittests 16.33% <18.18%> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 29 '24 17:02 codecov[bot]

clgtm, I think we need to implement some policies on when to log stack traces though. cc @JoaoJandre

I think that some guidelines would be good, sadly the discussion regarding this never got traction on the dev mailing list.

JoaoJandre avatar Mar 04 '24 13:03 JoaoJandre

clgtm, I think we need to implement some policies on when to log stack traces though. cc @JoaoJandre

I think that some guidelines would be good, sadly the discussion regarding this never got traction on the dev mailing list.

maybe this will work better : #8746

DaanHoogland avatar Mar 05 '24 10:03 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Mar 08 '24 10:03 github-actions[bot]

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 13 '24 06:06 github-actions[bot]

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 25 '24 14:06 github-actions[bot]

@blueorangutan package

DaanHoogland avatar Jul 01 '24 08:07 DaanHoogland

@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 avatar Jul 01 '24 08:07 blueorangutan

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

blueorangutan avatar Jul 01 '24 08:07 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jul 01 '24 08:07 github-actions[bot]

@blueorangutan package

DaanHoogland avatar Aug 22 '24 13:08 DaanHoogland

@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 avatar Aug 22 '24 13:08 blueorangutan

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

blueorangutan avatar Aug 22 '24 15:08 blueorangutan

@blueorangutan test

DaanHoogland avatar Aug 23 '24 07:08 DaanHoogland

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

blueorangutan avatar Aug 23 '24 07:08 blueorangutan

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

Test Result Time (s) Test File
test_08_arping_in_ssvm Failure 5.25 test_diagnostics.py
test_13_retrieve_vr_default_files Failure 129.40 test_diagnostics.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failure 179.10 test_routers_network_ops.py

blueorangutan avatar Aug 23 '24 22:08 blueorangutan

trying insanity, all failures seem internet connectivity related.

DaanHoogland avatar Aug 26 '24 08:08 DaanHoogland

@blueorangutan test

DaanHoogland avatar Aug 26 '24 08:08 DaanHoogland

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

blueorangutan avatar Aug 26 '24 08:08 blueorangutan

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

Test Result Time (s) Test File
test_CRUD_operations_userdata Error 1549.62 test_register_userdata.py
test_deploy_vm_with_registered_userdata Error 5.69 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_allow Error 5.38 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_append Error 5.40 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_deny Error 5.42 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_params Error 5.35 test_register_userdata.py
test_link_and_unlink_userdata_to_template Error 5.07 test_register_userdata.py
test_user_userdata_crud Error 5.30 test_register_userdata.py
ContextSuite context=TestResetVmOnReboot>:setup Error 0.00 test_reset_vm_on_reboot.py
ContextSuite context=TestRAMCPUResourceAccounting>:setup Error 0.00 test_resource_accounting.py
test_03_register_template Error 1.14 test_resource_names.py
ContextSuite context=TestRestoreVM>:setup Error 0.00 test_restore_vm.py
ContextSuite context=TestRouterDHCPHosts>:setup Error 0.00 test_router_dhcphosts.py
ContextSuite context=TestRouterDHCPOpts>:setup Error 0.00 test_router_dhcphosts.py
ContextSuite context=TestRouterDns>:setup Error 0.00 test_router_dns.py
ContextSuite context=TestRouterDnsService>:setup Error 0.00 test_router_dnsservice.py
ContextSuite context=TestRouterIpTablesPolicies>:setup Error 0.00 test_routers_iptables_default_policy.py
ContextSuite context=TestVPCIpTablesPolicies>:setup Error 0.00 test_routers_iptables_default_policy.py
ContextSuite context=TestIsolatedNetworks>:setup Error 0.00 test_routers_network_ops.py
ContextSuite context=TestRedundantIsolateNetworks>:setup Error 0.00 test_routers_network_ops.py
ContextSuite context=TestRouterServices>:setup Error 0.00 test_routers.py
ContextSuite context=TestCpuCapServiceOfferings>:setup Error 0.00 test_service_offerings.py
ContextSuite context=TestServiceOfferings>:setup Error 0.26 test_service_offerings.py
ContextSuite context=TestSetSourceNatIp>:setup Error 0.00 test_set_sourcenat.py
ContextSuite context=TestSnapshotRootDisk>:setup Error 0.00 test_snapshots.py
ContextSuite context=TestSnapshotStandaloneBackup>:setup Error 0.00 test_snapshots.py
test_10_reboot_cpvm_forced Error 9.43 test_ssvm.py
test_05_vmschedule_test_e2e Failure 362.62 test_vm_schedule.py

blueorangutan avatar Aug 27 '24 12:08 blueorangutan

@blueorangutan LLtest

DaanHoogland avatar Aug 28 '24 07:08 DaanHoogland

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

blueorangutan avatar Aug 28 '24 07:08 blueorangutan

@vishesh92 is this one good to go?

DaanHoogland avatar Aug 28 '24 07:08 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jan 08 '25 13:01 github-actions[bot]