Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsconfiguring log4j
https://www.eclipse.org/forums/index.php/mv/msg/368002/897555/#msg_897555
I'm taking the risk of asking a stupid question, but I just can't get it...
I have written a log4j fragment with a log4j.properties and it works fine with a launch configuration where org.eclipse.xtext.logging is not present. But when I install my plugin as an user, how do I make sure my configuration is the one that gets used? The xtext.logging fragment is already installed with the SDK.
Should I load the properties file and use it to configure log4j myself, instead of relying on it finding the right config file?
In a related topic, if I want to use an EclipseLogAppender like xtext.logging does, I have to implement another one in my code, right?
best regards,
Vlad
]]>Vlad Dumitrescu2012-07-24T13:31:50-00:00Re: configuring log4j
https://www.eclipse.org/forums/index.php/mv/msg/368002/897562/#msg_897562
classpath or that your fragment has a higher precedence. I'm not sure
about the latter ...
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 24.07.12 15:31, schrieb Vlad Dumitrescu:
> Hi,
>
> I'm taking the risk of asking a stupid question, but I just can't get it...
>
> I have written a log4j fragment with a log4j.properties and it works
> fine with a launch configuration where org.eclipse.xtext.logging is not
> present. But when I install my plugin as an user, how do I make sure my
> configuration is the one that gets used? The xtext.logging fragment is
> already installed with the SDK.
>
> Should I load the properties file and use it to configure log4j myself,
> instead of relying on it finding the right config file?
>
> In a related topic, if I want to use an EclipseLogAppender like
> xtext.logging does, I have to implement another one in my code, right?
> best regards,
> Vlad
>]]>Sebastian Zarnekow2012-07-24T13:57:21-00:00Re: configuring log4j
https://www.eclipse.org/forums/index.php/mv/msg/368002/897723/#msg_897723
regards,
Vlad
]]>Vlad Dumitrescu2012-07-25T07:26:32-00:00Re: configuring log4j
https://www.eclipse.org/forums/index.php/mv/msg/368002/902686/#msg_902686
having wasted some hours trying to get log4j running in an Eclipse application I found out about the Xtext plugin as well. By debugging, I found the following solution:
In your fragment, use a log4j.xml instead of a log4j.properties.
The log4j framework tries to find the .xml before the .properties.
This will only work until the Xtext team decides to move to .xml. I have not found a way to specify fragment precedence yet.
Andreas
]]>Andreas Graf2012-08-19T15:21:38-00:00Re: configuring log4j
https://www.eclipse.org/forums/index.php/mv/msg/368002/902687/#msg_902687
Right now I do the configuration manually, which has also the advantage that I can watch for a local configuration file and reload it if it changes. More exactly, if I want to watch it anyway, doing the initial configuration manually is not a big deal.