GutoVeronezi commented on PR #7131: URL: https://github.com/apache/cloudstack/pull/7131#issuecomment-1494407751
Hello guys, I created an environment from scratch and did some exhausting tests with logging these last few days. Everything seems to be working fine with MS, Usage, and Agent; however, for system VMs I found a point that needs to be fixed: The Log4j is not initialized properly in the system VMs; I dug a little bit and found out that it happens due to some dependency conflicts between `cloud-utils` and `log4j-api-2.19.0.jar`. When `cloud-utils` is loaded first, Log4j is not initialized with the configuration XML; otherwise, if `log4j-api-2.19.0.jar` is loaded first, everything seems to work fine. I did not go deeper to understand why, though. There are some minor improvements to do as well: - In Usage, some classes are being printed with the enhancer suffix, which was not being printed before: `DEBUG [cloud.usage.UsageManagerImpl_EnhancerByCloudStack_6c3dfde5] (main:[]) (logid:) Usage stats aggregation time zone: GMT`. We can remove it to make the logs cleaner. - In all components, when an exception occurs, the jar/version is printed in the stack. We can remove it to make the logs cleaner. ``` 2023-04-02T15:41:12,830 ERROR [utils.linux.KVMHostInfo] (Agent-Handler-1:[]) (logid:) Unable to retrieve the CPU speed from file [/sys/devices/system/cpu/cpu0/cpufreq/base_frequency] java.io.FileNotFoundException: /sys/devices/system/cpu/cpu0/cpufreq/base_frequency (No such file or directory) at java.io.FileInputStream.open0(Native Method) ~[?:?] at java.io.FileInputStream.open(FileInputStream.java:219) ~[?:?] at java.io.FileInputStream.<init>(FileInputStream.java:157) ~[?:?] at java.io.FileInputStream.<init>(FileInputStream.java:112) ~[?:?] at java.io.FileReader.<init>(FileReader.java:60) ~[?:?] at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeedFromFile(KVMHostInfo.java:136) ~[cloud-plugin-hypervisor-kvm-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeed(KVMHostInfo.java:105) ~[cloud-plugin-hypervisor-kvm-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at org.apache.cloudstack.utils.linux.KVMHostInfo.getHostInfoFromLibvirt(KVMHostInfo.java:180) ~[cloud-plugin-hypervisor-kvm-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at org.apache.cloudstack.utils.linux.KVMHostInfo.<init>(KVMHostInfo.java:66) ~[cloud-plugin-hypervisor-kvm-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.initialize(LibvirtComputingResource.java:3468) ~[cloud-plugin-hypervisor-kvm-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at com.cloud.agent.Agent.sendStartup(Agent.java:444) ~[cloud-agent-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at com.cloud.agent.Agent$ServerHandler.doTask(Agent.java:1102) ~[cloud-agent-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at com.cloud.utils.nio.Task.call(Task.java:83) ~[cloud-utils-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at com.cloud.utils.nio.Task.call(Task.java:29) ~[cloud-utils-4.19.0.0-SNAPSHOT.jar:4.19.0.0-SNAPSHOT] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?] at java.lang.Thread.run(Thread.java:829) ~[?:?] ``` - The new dependencies are not being mapped in some commands called by `cloud-install-sys-tmplt`: `ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...`. Aside from that, the configurations are fine. This upgrade will facilitate a lot the contributors work and also the troubleshooting process; Great job, @JoaoJandre. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org