Forum Discussion

AlbertSoapUI's avatar
AlbertSoapUI
Contributor
6 years ago

Groovy command log.setLevel generates compiling errors after upgrading to ReadyAPI 2.5.0

Hi,

 

I am maintaining a project that contains a lot of groovy scripts with command 

log.setLevel Level.DEBUG;

 

If I upgrade to ReadyAPI 2.5.0 this generates compiling errors, as included library log4j 2 does no longer implement this method:

groovy.lang.MissingMethodException: No signature of method: org.apache.logging.log4j.core.Logger.setLevel() is applicable for argument types: (org.apache.log4j.Level) values:

 

Is there a simple one-line substitution possible for this command?

I have been looking around, but apache seems to suggest much more complicated solutions to manage control over log levels.

Now I just simply comment the lines with 'log.setLevel', as I am not so much interested in it now, but things may change.

 

Anyone? Thanks!

 

Albert

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi Albert,

     

    Please refer to this topic to learn the libraries that have been removed from, added to, or updated in ReadyAPI 2.5.0: https://support.smartbear.com/readyapi/docs/general-info/version-history/libraries-updated-in-latest-ver.html

     

    Also, please refer to the following articles which should help you: 

    Migrating from Log4j 1.x: http://logging.apache.org/log4j/2.x/manual/migration.html

     

    "Calls to org.apache.log4j.Logger.setLevel() or similar methods are not supported in the API. Applications should remove these. Equivalent functionality is provided in the Log4j 2 implementation classes, see org.apache.logging.log4j.core.config.Configurator.setLevel(), but may leave the application susceptible to changes in Log4j 2 internals."

     

    Changelog: http://logging.apache.org/log4j/2.x/changelog.html

     

    • Olga_T's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi everyone,

       

      Nastya_Khovrina, thank you for the explanation.

       

      AlbertSoapUI, did Anastasia's reply help? If so, do you mind marking it as a solution? 

      If it didn't help, we are looking forward to getting more details from you.

       

      Thanks,

      • AlbertSoapUI's avatar
        AlbertSoapUI
        Contributor

        Hi Olga, Nastya,

        Thank you for the elaborate information.

        I was aware of the change, but was hoping for a simple workaround concerning that single line of code.

        If removing those lines is the only simple workaround, then I will accept this as a solution.

        Will wait a short while in case other suggestions come in.

        Regards, Albert