cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
Occasional Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

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

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...

 

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

 



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

3 REPLIES 3
Highlighted
Moderator

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

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...

 

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

 



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

Highlighted
Moderator

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

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,


Olga Terentieva
SmartBear Assistant Community Manager

Highlighted
Occasional Contributor

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

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

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Filtering data retrieved from a DataSource

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors