This morning, DD noticed JetBrains’ official blog post announcing that log4j will be removed from the IntelliJ platform in version 2022.1.

The intellij-based IDE does not use log4j2, but a patched version of Log4j 1.2 (all network related code has been removed). Log4j nuclear bomb vulnerability outbreak, according to the official announcement, a large number of its development tools products are not affected.

At the heart of the decision to remove Log4j is the fact that the IDE for the IntelliJ platform has very little need for logging (only for information to files and consoles) and that Log4j is too complex (introducing too much third-party content directly or indirectly). To avoid other potential problems in the future, the log4J dependency will be removed.

scope

Removing Log4j from development tools doesn’t really affect most developers, but if you’re a plug-in developer, it does. So, here are some official suggestions:

  • If you use Log4J in your plug-in code: Switch to using the standard platform logging APIcom.intellij.openapi.Diagnotic.Logger
  • If you use Log4J in your own code, that code is available in plug-in and other contexts: switch to using the SLF4J API. The IntelliJ platform passedjava.util.logAn implementation of the SLF4J API is included, so the platform fully supports SLF4J logging.
  • If log4J is used in code dependencies: Request dependency maintainers switch to SLF4J. If this is not possible, logging from dependencies will most likely continue to work thanks to the Log4j to SLF4J bridge.
  • If you use log4jAPI to customize logging for dependencies that use SLF4J: Switch to usejava.util.logingAPITo configure handlers and logging levels.
  • If you use the log4jXML file to configure logging in your tests: Switch to using.propertiesConfiguration of the file, as described in the LogManager documentation. Can be used when running tests using the IntelliJ testing frameworkidea.log.config.propertiesFile system properties Path to the log properties file.

DD feels that removing Log4j is a good lesson for a product like IntelliJ, as it is officially stated that log4j is too complex and introduces a lot of other things that are not useful to you and do cause some problems. Leaving aside security issues, as far as dependency management is concerned, most of the dependency conflicts that DD used to find for other developers were caused by the introduction of complex, high-level dependencies.

Finally, which of the six principles of object-oriented design does JetBrains adhere to? Leave a comment with your answer!

We have created a high-quality technical communication group, with excellent people together, they will be excellent, click add group quickly, enjoy the happiness of growing up together.

Welcome to pay attention to my public number: program ape DD. Learn cutting-edge industry news, share in-depth technical know-how, and obtain high-quality learning resources at the first time