<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Logging RCP applications with Pax Logging</title>
	<atom:link href="http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Tue, 27 Jul 2010 15:47:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8952</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 01 Jun 2010 19:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8952</guid>
		<description>Hi Jon,

Just did some research, as I&#039;ve never done what you&#039;re trying to do. You need to execute the following code as your application starts up.

MessageConsole console = new MessageConsole(&quot;System Output&quot;, null);
ConsolePlugin.getDefault().getConsoleManager()
	.addConsoles(new IConsole[] { console });
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
MessageConsoleStream stream = console.newMessageStream();

System.setOut(new PrintStream(stream));
System.setErr(new PrintStream(stream));

Hope this helps,

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>Just did some research, as I&#8217;ve never done what you&#8217;re trying to do. You need to execute the following code as your application starts up.</p>
<p>MessageConsole console = new MessageConsole(&#8220;System Output&#8221;, null);<br />
ConsolePlugin.getDefault().getConsoleManager()<br />
	.addConsoles(new IConsole[] { console });<br />
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);<br />
MessageConsoleStream stream = console.newMessageStream();</p>
<p>System.setOut(new PrintStream(stream));<br />
System.setErr(new PrintStream(stream));</p>
<p>Hope this helps,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8951</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 01 Jun 2010 18:19:36 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8951</guid>
		<description>Hi Jon,

Are you running the RCP application with the -consoleLog argument?

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>Are you running the RCP application with the -consoleLog argument?</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Svede</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8878</link>
		<dc:creator>Jon Svede</dc:creator>
		<pubDate>Fri, 28 May 2010 21:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8878</guid>
		<description>Thanks for the pointers!

I created a custom target based on the Eclipse platform and then I added another directory containing the bundles you posted about.  In that target it says it loading 800 plugins. The view loads ok in my app (and I get no errors in the .log file), but no logging shows.  I know I am getting logging via Pax because in the IDE&#039;s console I see it.

I don&#039;t know if this matters much but I am launching the app via a product config launch (rather than just launching the application).

In the launch config, I am already clearing the workspace (and I&#039;ve also occassionally checked the box for clearing the config as well).

--Jon</description>
		<content:encoded><![CDATA[<p>Thanks for the pointers!</p>
<p>I created a custom target based on the Eclipse platform and then I added another directory containing the bundles you posted about.  In that target it says it loading 800 plugins. The view loads ok in my app (and I get no errors in the .log file), but no logging shows.  I know I am getting logging via Pax because in the IDE&#8217;s console I see it.</p>
<p>I don&#8217;t know if this matters much but I am launching the app via a product config launch (rather than just launching the application).</p>
<p>In the launch config, I am already clearing the workspace (and I&#8217;ve also occassionally checked the box for clearing the config as well).</p>
<p>&#8211;Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8873</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Fri, 28 May 2010 19:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8873</guid>
		<description>Hi Jon,

Yes, you&#039;re right that if the log4j.properties file is configured to log to the console then the log output should appear in the Console View.

As for why the Console View is not appearing, you don&#039;t need to follow the steps in that FAQ. The FAQ only applies if you want to control the console programmatically. 

Here are a few things to check:

* Have you added the org.eclipse.ui.console bundle to your target platform? This is not part of the standard RCP SDK. Of course if you&#039;re using the entire Eclipse SDK as your target then the bundle will be there.

* If you&#039;re adding the view with the perspectiveExtensions extension point, you&#039;ll need to clear your workspace metadata to force the view to appear.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>Yes, you&#8217;re right that if the log4j.properties file is configured to log to the console then the log output should appear in the Console View.</p>
<p>As for why the Console View is not appearing, you don&#8217;t need to follow the steps in that FAQ. The FAQ only applies if you want to control the console programmatically. </p>
<p>Here are a few things to check:</p>
<p>* Have you added the org.eclipse.ui.console bundle to your target platform? This is not part of the standard RCP SDK. Of course if you&#8217;re using the entire Eclipse SDK as your target then the bundle will be there.</p>
<p>* If you&#8217;re adding the view with the perspectiveExtensions extension point, you&#8217;ll need to clear your workspace metadata to force the view to appear.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Svede</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8872</link>
		<dc:creator>Jon Svede</dc:creator>
		<pubDate>Fri, 28 May 2010 19:37:32 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8872</guid>
		<description>Thanks Patrick!

In my app I&#039;ve added the ConsoleView to the view by adding into my perspective in plugins.xml.  However, no window shows up.  I am assuming that this because I have to do something to get that window to show, probably something like what is posted here:

http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in_%3F

So, I am guessing that what you meant when you wrote &quot;You can definitely route the log to both a file and the console by creating the appropriate appenders&quot; is that if my log4j.properties is already specifying a console logger, it&#039;s just a matter of grabbing the right IConsole instance and forcing it to appear.  Is that right?

I am not going to worry about the per editor console just now, I think that is beyond my abilities today and really more of a nice to have.</description>
		<content:encoded><![CDATA[<p>Thanks Patrick!</p>
<p>In my app I&#8217;ve added the ConsoleView to the view by adding into my perspective in plugins.xml.  However, no window shows up.  I am assuming that this because I have to do something to get that window to show, probably something like what is posted here:</p>
<p><a href="http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in_%3F" rel="nofollow">http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in_%3F</a></p>
<p>So, I am guessing that what you meant when you wrote &#8220;You can definitely route the log to both a file and the console by creating the appropriate appenders&#8221; is that if my log4j.properties is already specifying a console logger, it&#8217;s just a matter of grabbing the right IConsole instance and forcing it to appear.  Is that right?</p>
<p>I am not going to worry about the per editor console just now, I think that is beyond my abilities today and really more of a nice to have.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8871</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Fri, 28 May 2010 19:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8871</guid>
		<description>Hi Jon,

I&#039;m glad the posts helped! You can definitely route the log to both a file and the console by creating the appropriate appenders. Of course, you&#039;ll need to add the console view to your application if you want to view it outside the IDE.

I&#039;m not sure how to route each editor&#039;s log to it&#039;s own console. It&#039;s possible to create multiple consoles, but how to connect the appender to a specific console would be the issue. My guess is that you&#039;d have to write custom code to manage this and I&#039;m guessing it wouldn&#039;t be easy. But if you get it working, let me know. It sounds like it could be useful.

Regards,

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>I&#8217;m glad the posts helped! You can definitely route the log to both a file and the console by creating the appropriate appenders. Of course, you&#8217;ll need to add the console view to your application if you want to view it outside the IDE.</p>
<p>I&#8217;m not sure how to route each editor&#8217;s log to it&#8217;s own console. It&#8217;s possible to create multiple consoles, but how to connect the appender to a specific console would be the issue. My guess is that you&#8217;d have to write custom code to manage this and I&#8217;m guessing it wouldn&#8217;t be easy. But if you get it working, let me know. It sounds like it could be useful.</p>
<p>Regards,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Svede</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-8867</link>
		<dc:creator>Jon Svede</dc:creator>
		<pubDate>Fri, 28 May 2010 14:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-8867</guid>
		<description>Based on these really excellent posts I am using PAX in an RCP app  - so far, so good!

However, now I&#039;ve been asked if it is possible to log to a file AND to a console - in the application.  Furthermore, I&#039;ve been asked if it were possible to have each editor have it&#039;s own console.

Is that possible from a configuration or would I need to write something specifically to do this?  Meaning would I need to provide a log4j appender that is capable of writing to the console?  Or am I off in the weeds?

Thanks,

Jon</description>
		<content:encoded><![CDATA[<p>Based on these really excellent posts I am using PAX in an RCP app  &#8211; so far, so good!</p>
<p>However, now I&#8217;ve been asked if it is possible to log to a file AND to a console &#8211; in the application.  Furthermore, I&#8217;ve been asked if it were possible to have each editor have it&#8217;s own console.</p>
<p>Is that possible from a configuration or would I need to write something specifically to do this?  Meaning would I need to provide a log4j appender that is capable of writing to the console?  Or am I off in the weeds?</p>
<p>Thanks,</p>
<p>Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-3442</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 01 Dec 2009 00:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-3442</guid>
		<description>Hi Phil,

I haven&#039;t looked into this myself, but it appears that Pax Logging provides a default log4j.properties file internally. This is mentioned in the following article:

http://wiki.ops4j.org/display/paxlogging/How+to+use+Pax+Logging

One option would be to simply open the bundle and modify the file by hand, but of course this would be a maintenance headache as new Pax Logging versions were released.

Placing the same file in a fragment would not work, as the bundle class path is searched before any fragment class paths.

Having said all this, there may be a way to do this that I&#039;m not aware of. You may want to ask on the Pax mailing lists, and please do let me know if you find a good solution.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Phil,</p>
<p>I haven&#8217;t looked into this myself, but it appears that Pax Logging provides a default log4j.properties file internally. This is mentioned in the following article:</p>
<p><a href="http://wiki.ops4j.org/display/paxlogging/How+to+use+Pax+Logging" rel="nofollow">http://wiki.ops4j.org/display/paxlogging/How+to+use+Pax+Logging</a></p>
<p>One option would be to simply open the bundle and modify the file by hand, but of course this would be a maintenance headache as new Pax Logging versions were released.</p>
<p>Placing the same file in a fragment would not work, as the bundle class path is searched before any fragment class paths.</p>
<p>Having said all this, there may be a way to do this that I&#8217;m not aware of. You may want to ask on the Pax mailing lists, and please do let me know if you find a good solution.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Kursawe</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-3430</link>
		<dc:creator>Phil Kursawe</dc:creator>
		<pubDate>Mon, 30 Nov 2009 18:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-3430</guid>
		<description>I wonder if it is possible to configure Pax-Logging via fragment bundle and feed it a default config file?</description>
		<content:encoded><![CDATA[<p>I wonder if it is possible to configure Pax-Logging via fragment bundle and feed it a default config file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2009/07/14/logging-rcp-applications-with-pax-logging/comment-page-1/#comment-2229</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Fri, 16 Oct 2009 18:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.com/?p=568#comment-2229</guid>
		<description>Hi Niko,

Do you get an error message indicating why the logging bundle doesn&#039;t start? I&#039;m assuming you&#039;ve installed Pax ConfMan as well.

BTW, if you&#039;re targeting Felix you may just want to start with the Apache Karaf server. It&#039;s basically Felix plus some standard services, including Pax Logging.

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Niko,</p>
<p>Do you get an error message indicating why the logging bundle doesn&#8217;t start? I&#8217;m assuming you&#8217;ve installed Pax ConfMan as well.</p>
<p>BTW, if you&#8217;re targeting Felix you may just want to start with the Apache Karaf server. It&#8217;s basically Felix plus some standard services, including Pax Logging.</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
</channel>
</rss>
