Forum Discussion

tbake0155's avatar
tbake0155
New Contributor
5 years ago

log4j2 upgrade

Hi SmartBear Community,

 

I'm working on upgrading log4j in soapui from version 1.2 to version 2.12.  I need to upgrade log4j in the soapui-maven-plugin in order to use it due to API incompatibilities between the versions. 

 

I forked the 5.6.0-SNAPSHOT soapui code from github, which you can find here https://github.com/tbake0155/soapui

 

I already started working on the upgrade.  Most of the code changes have been taken care of but I still need to get all of the tests working and get the log4j2.xml files loading properly.  Soapui uses unique names for the log4j xml files (e.g., soapui-test-log4j.xml rather than log4j.xml), and because of that, I'm not sure if they are loading properly but I'm looking into it. Log4j2 will ignore log4j.xml files, and will look for logj42.xml files instead.  I changed the configuration file names to, for example, soapui-test-logj42.xml.  Anyways I think this is not an insurmountable task and I'm hoping to get it mostly done in a few days.  I was able to get the entire package to build successfully but I still have to look into some unit test failues and again I think there's an issue with the xml files still.

 

If anyone wants to get involved or has suggestions/best practices you think I should be aware of, I'd be glad to hear it.

 

Thanks,

 

Tim Baker

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Note that haven't build it from git.
    Are you looking for any features /fixes that are available in github?
    After forking, what changes have you made? And what is error?
    Is that just log4j version change?
    • tbake0155's avatar
      tbake0155
      New Contributor

      Hi Rao,

       

      Thanks for replying.  I actually just committed my changes to github, I apologize I thought I had previously committed.  The project will build but isn't passing all tests.  I haven't worked on it since  Friday but at that time I was running into an issue where I was going to have to add a "throws URISynaxException" to hundreds of methods in hundreds of classes, so I need to figure out a better solution for that issue.  I need to do some work on it but got pulled into something else the last few days and might not get back to it today (although I would like to).

       

      Regarding your questions,

       

      1) I'm not specifically looking for any features except that I need log4j2 API compatibility in the soapui-maven-plugin.  I'm working on a project to upgrade a bunch of old packages in a decade old webapp, Log4j is one of those packages.  We also have a package that used maven-soapui-plugin 4.5.1.  I'm starting with the newer version since I get the same error using soapui-maven-plugin 5.x (the error is due to log4j API incompatibility, I can post the exact error if that's useful).

       

      2) After forking, the changes I made are pretty substantial but all related to upgrading log4j to log4j2.  That includes upgrading all log4j.xml files to be log4j2 compliant.  Because soapui implements custom appenders, I also had to make changes to those.  The changes were pretty straight forward and although I may not have captured all of the functionality that was in place previously, I got most of it and it should work for my purposes.  It could easily be continued upon to robustly implement log4j2 since the lift is really not that big, especially for someone familiar with the codebase.

       

      3) Correct, but the APIs changed and because soapui implements custom appenders, it's not as simple as using the convenient log4j1 to log4j2 bridge api.

       

      Thanks,

       

      Tim

       

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        No problem.

        Thanks for adding details. Hope you are now able to build without any issue.