Perhaps the problem is that log4j-api.jar does not have a Automatic-Module-Name in its MANIFEST.MF. Only the log4j-core.jar has this entry in its manifest file. Den lør. 23. jun. 2018 kl. 14:00 skrev Sverre Moe <[email protected]>: > > Apache Log4j may have a wrong Automatic-Module-Name > requires org.apache.logging.log4j.core; > > I cannot use the Logger and LogManager classes because they are not > accessible to my module. > > import org.apache.logging.log4j.LogManager; > import org.apache.logging.log4j.Logger; > private Logger logger = LogManager.getLogger(this.getClass()); > > The type org.apache.logging.log4j.LogManager is not accessible > The type org.apache.logging.log4j.Logger is not accessible > > > "This is the central interface in the log4j package. Most logging > > operations, except configuration, are done through this interface. The > > canonical way to obtain a Logger for a class is through {@link > > LogManager#getLogger()}." > > The Logger implementation is accessible: > import org.apache.logging.log4j.core.Logger; > > It seems to me that the classes in core package is not to be accessed > directly by those using Log4j. > > This leads me to believe no one has actually begun to use Log4j in a > modular project. Because how can they when they cannot access the API. > > The Automatic-Module-Name should be instead "org.apache.logging.log4j". > If the classes under the core package should not be used then it > should not be exported. > Perhaps then the Automatic-Module-Name needs to be > "org.apache.logging.log4j.api". > > But this is just the automatic module name that log4j has set. What is > actually exported is also wrong. The Export-Package in JAR MANIFEST.MF > exports not the API, but the implementation.
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
