Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » configuring log4j
configuring log4j [message #897555] Tue, 24 July 2012 13:31 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
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
Re: configuring log4j [message #897562 is a reply to message #897555] Tue, 24 July 2012 13:57 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
The only chance is to make sure that xtext.logging is not on the
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
>
Re: configuring log4j [message #897723 is a reply to message #897562] Wed, 25 July 2012 07:26 Go to previous messageGo to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Ok, thanks! I will then configure log4j manually in my plugin activator.

regards,
Vlad
Re: configuring log4j [message #902686 is a reply to message #897555] Sun, 19 August 2012 15:21 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
Hi Vlad,

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
Re: configuring log4j [message #902687 is a reply to message #902686] Sun, 19 August 2012 15:38 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Thanks Andreas,

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.

regards,
Vlad
Previous Topic:Acceleo and Xtext
Next Topic:How can I customize the Preference Pages?
Goto Forum:
  


Current Time: Thu Mar 28 21:55:19 GMT 2024

Powered by FUDForum. Page generated in 0.02386 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top