Bug 60564 - Migrate LogKit to SLF4J - Replace logkit loggers with slf4j ones and keep the current logkit binding solution for backward compatibility with plugins
Summary: Migrate LogKit to SLF4J - Replace logkit loggers with slf4j ones and keep the...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.1
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks: 60565
  Show dependency tree
 
Reported: 2017-01-09 17:28 UTC by Woonsan Ko
Modified: 2017-02-11 08:35 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Woonsan Ko 2017-01-09 17:28:12 UTC
As being discussed in the dev thread [1], the first step would be to replace each logkit logger with slf4j logger.

An example:

[AS-IS]
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListener, ActionListener {

    private static final Logger log = LoggingManager.getLoggerForClass();

[TO-BE]
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListener, ActionListener {

    private static final Logger log = LoggerFactory.getLogger(HTMLAssertionGui.class);


[1] http://markmail.org/thread/tloqa5zmuj26nrqn
Comment 1 Jerome 2017-01-11 19:30:24 UTC
That would be awesome, you have my support. Having Avalon, Excalibur and Log4j all in the  classpath of our application is a pain. For each jmeter maven artifact we import, we need to duplicate a huge exclusion list to avoid conflicts with internal modules.
Comment 2 Philippe Mouawad 2017-01-11 19:50:55 UTC
Hello Woonsan Ko,
You can proceed, I suggest you provide patches or github PR the following way:
- For now avoid touching classes mentionned in PR 245 to 247 and 237, 240
- Group patches , 1 per packages , and for reduced components you can provide a patch for the component for example protocol/ftp...


Thank a lot for your work.
Comment 3 Woonsan Ko 2017-01-12 18:06:15 UTC
First PR: https://github.com/apache/jmeter/pull/250, for protocol/java component only for easier review/merge.
Comment 4 Philippe Mouawad 2017-02-05 21:13:58 UTC
Author: pmouawad
Date: Sun Feb  5 21:13:34 2017
New Revision: 1781806

URL: http://svn.apache.org/viewvc?rev=1781806&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution
Contributed by Woonsan Ko
This closes #250
Bugzilla Id: 60564

Modified:
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/JavaConfig.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/AbstractJavaSamplerClient.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSamplerContext.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/test/JavaTest.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/test/SleepTest.java
Comment 5 Philippe Mouawad 2017-02-05 21:23:23 UTC
Thanks for contribution.
I merged it partially excluding the classes that are port of Client API:
- AbstractJavaSamplerClient through getLogger
- JSR223 Sampler
- BSF Sampler
- Beanshell Sampler

I'm afraid that to keep backward compatibility we need to keep them.
Comment 6 Philippe Mouawad 2017-02-05 22:19:06 UTC
Author: pmouawad
Date: Sun Feb  5 22:18:49 2017
New Revision: 1781816

URL: http://svn.apache.org/viewvc?rev=1781816&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution
Use slf4j parameterized messages
Bugzilla Id: 60564

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/InitialContextFactory.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/Publisher.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/BaseJMSSampler.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/Receiver.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
Comment 7 Philippe Mouawad 2017-02-05 22:23:07 UTC
Author: pmouawad
Date: Sun Feb  5 22:22:46 2017
New Revision: 1781817

URL: http://svn.apache.org/viewvc?rev=1781817&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution
Use slf4j parameterized messages
Bugzilla Id: 60564

Modified:
    jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
    jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java
Comment 8 Philippe Mouawad 2017-02-05 22:40:25 UTC
Author: pmouawad
Date: Sun Feb  5 22:35:34 2017
New Revision: 1781825

URL: http://svn.apache.org/viewvc?rev=1781825&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution

Bugzilla Id: 60564

Modified:
    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/gui/SystemSamplerGui.java

Author: pmouawad
Date: Sun Feb  5 22:39:54 2017
New Revision: 1781826

URL: http://svn.apache.org/viewvc?rev=1781826&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution

Modified:
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
Comment 9 Philippe Mouawad 2017-02-05 22:57:10 UTC
Author: pmouawad
Date: Sun Feb  5 22:56:26 2017
New Revision: 1781828

URL: http://svn.apache.org/viewvc?rev=1781828&view=rev
Log:
Bug 60564 - Migrating LogKit to SLF4J - Replace logkit loggers with slf4j ones with keeping the current logkit binding solution

Bugzilla Id: 60564

Modified:
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoSourceElement.java
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoSourceElementBeanInfo.java
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/mongo/MongoDB.java
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptRunner.java
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSamplerBeanInfo.java
Comment 10 Philippe Mouawad 2017-02-11 08:35:50 UTC
PR Merger: pmouawad
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Author : Woonsan Ko 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Date: Sat Feb 11 08:35:08 2017
New Revision: 1782556

URL: http://svn.apache.org/viewvc?rev=1782556&view=rev
Log:
Bug 60564 - Migrate LogKit to SLF4J - Replace logkit loggers with slf4j ones and keep the current logkit binding solution for backward compatibility with plugins
Contributed by Woonsan Ko
Done by PRs 263 to 274
Bugzilla Id: 60565

Modified:
    jmeter/trunk/xdocs/changes.xml