3

As far as I have understood reading online articles, the embedded data-logger in Eclipse should be best deal especially if you're implementing an RCP app. (Confirm?)

Anyway I'm struggling using it.

The first issue I have faced is a problem with Injection:

import org.eclipse.e4.core.services.Logger;

@Inject
private Logger logger;

In an MPart it produces a null variable.

unclejohn00
  • 149
  • 10
  • Have you added `org.eclipse.e4.core.services` to the plug-in deps? – rlegendi Dec 02 '14 at 22:43
  • Which version of Eclipse? In Eclipse 4.4 the Logger is in the `org.eclipse.e4.core.services.log` package. But you should get a 'cannot find instance of logger' injection error if an instance of the class cannot be found. Don't forget that field injection is done after construction, so you can't use this field in the constructor. – greg-449 Dec 03 '14 at 08:30
  • I'm using Eclipse Luna 4.4 and the declaration is set after construction – unclejohn00 Dec 03 '14 at 09:58
  • Anyway now it works! Probably i screwed up with dependencies. Is it better to use the embedded Logger or log4j? What do you think? – unclejohn00 Dec 03 '14 at 10:20
  • If you use third-party libraries that use some other well-known loggers, log4j allows you to redirect their output to your log. – Severin Dec 04 '14 at 11:59

0 Answers0