Le 11/01/15 11:58, Stefan Seelmann a écrit :
> Hi Emmanuel,
>
> Pierre-Arnaud and I already tried that. IIRC it is not so easy, if using
> because we are within an OSGi environment. If you use log4j (which is a
> bundle itself) it tries to load the log4j.properties, but it can only
> access resources within its own classloader, so it can't load the
> log4j.properties defined e.g. in a Studio pllugin. There are tricks like
> embedding log4j into the plugin or use "buddy class loading" but all not
> so nice. Pax-logging also exists. Another idea is to create our own
> Logging plugin which provides a logger service.
>
> As we are in Eclipse I'd stick to the log service it provides.
>
> You can create a util class with some convenience methods, see
> PluginUtils in schemaeditor plugin as example.
>
> Eclipse 4 introduced a new programming model, where you can just inject
> a Logger and it also has more convenient logging methods [1]. But that
> migration needs to be done later...
>
> But the most important question: What do you want to achieve? I think
> silently logging into a file within a interactive GUI doesn't make too
> much sense, right?
Right. Except that it would be useful for users who have a problem to
report it into a JIRA with the log attached.

Anyway, maybe the best is to get the plugin you are in, and log using
it, as you can select a level. Atm, it fits my need.


Reply via email to