saros
saros copied to clipboard
Complete Log4j2 migration
With #270/#1064 we migrated the Log4j backend to Log4j2. Only the framework set-up and initialization had to be migrated in this step. However, we still use the old API (of log4j) instead of the log4j2 API. Migrating the API leads to changes in a myriad of files. Therefore, we should automate as much as possible.
You can find further information in the logging docs.
I wrote a small migration script (Disclaimer: This script uses heuristics and the output should be validated). It should migrate all relevant calls, but manual changes are required if:
- A function call is migrated to a closure, but an object is not accessible in the closure context.
- A method is still wrapped in an
ifTraceEnabledif-block.
I would recommend avoiding a big bang migration and use the script to migrate packages or components (e.g. core) step-by-step.