apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.08k stars 2.05k forks source link

Migrate log4j2 to logback #5937

Open vlsi opened 1 year ago

vlsi commented 1 year ago

Use case

Log4j 2.x introduces unclear changes, so we might better stick with a more stable logging solution.

The current log4j2 in JMeter produces an unclear warning:

WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release
WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release

Possible solution

No response

Possible workarounds

No response

JMeter Version

5.5

Java Version

No response

OS Version

No response

jeroenhabets commented 1 year ago

FYI Changing bin/log4j2.xml to remove the packages attribute as a workaround but it does not work:

Current: <Configuration status="WARN" packages="org.apache.jmeter.gui.logging">

Tried: <Configuration status="WARN"> But got:

ERROR StatusConsoleListener Error processing element GuiLogEvent ([Appenders: null]): CLASS_NOT_FOUND
ERROR StatusConsoleListener Unable to locate appender "gui-log-event" for logger config "root"
QAInsights commented 11 months ago

Adding more context about deprecated status.

jeroenhabets commented 11 months ago

Adding more context about deprecated status.

@QAInsights "more context" link did not scroll to https://logging.apache.org/log4j/2.x/manual/configuration.html#ConfigurationSyntax for me in Firefox (due to trailing text?)

@vlsi relevant text there is:

packages - Use of the packages attribute is deprecated and will be removed in Log4j 3.0. Plugins should be processed with the Log4j annotation processor. A comma separated list of package names to search for plugins. Plugins are only loaded once per classloader so changing this value may not have any effect upon reconfiguration.

QAInsights commented 11 months ago

Yes @jeroenhabets, but in Chromium-based browsers it works fine. :)

nitinsreevstv commented 2 weeks ago

While running the ./jmeter, showing this.

WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398) at java.base/java.lang.Runtime.load0(Runtime.java:755) at java.base/java.lang.System.load(System.java:1957) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) at java.base/java.lang.System.loadLibrary(System.java:1993) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1388) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1386) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1385) at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1423) at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1397) at java.desktop/java.awt.Component.<clinit>(Component.java:624) at java.desktop/javax.swing.ImageIcon$2.run(ImageIcon.java:145) at java.desktop/javax.swing.ImageIcon$2.run(ImageIcon.java:143) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.desktop/javax.swing.ImageIcon.createNoPermsComponent(ImageIcon.java:142) at java.desktop/javax.swing.ImageIcon$1.run(ImageIcon.java:114) at java.desktop/javax.swing.ImageIcon$1.run(ImageIcon.java:111) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/javax.swing.ImageIcon.<clinit>(ImageIcon.java:111) at org.apache.jmeter.plugin.PluginManager.installPlugin(PluginManager.java:59) at org.apache.jmeter.plugin.PluginManager.install(PluginManager.java:45) at org.apache.jmeter.JMeter.start(JMeter.java:487) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.jmeter.NewDriver.main(NewDriver.java:259) An error occurred: Could not initialize class java.awt.Toolkit

Can someone please help me in this

Java version - 17 OS - Ubuntu 23