Проблемы реализации Log4j в Eclipse EMF RCP с использованием Java 17, а не OSGJAVA

Программисты JAVA общаются здесь
Anonymous
Проблемы реализации Log4j в Eclipse EMF RCP с использованием Java 17, а не OSG

Сообщение Anonymous »


I'm working with Eclipse EMF RCP using Java 17 and trying to implement a logging system using Log4j. Despite various attempts, I'm unable to get it to work, including the creation of a directory for saving log messages. I've set up a standard Log4j2.xml configuration in the src folder and created a static Log4j instance with a loggerManager in the class that should generate log messages, but nothing seems to function. Any suggestions would be greatly appreciated.

I tried to use this standard file log4j2.xml:

` %d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n ` and tried to put this in the class. `import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger;

public class MyClass { private static final Logger logger = LogManager.getLogger(MyClass.class);`

I hope at least to get somme messages log in the logs/app.log and to create a view to read these messages


Источник: https://stackoverflow.com/questions/781 ... nd-not-osg

Вернуться в «JAVA»