Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » early start of log service
early start of log service [message #83208] Tue, 13 February 2007 12:39 Go to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Hello everybody!
I am using log4j for logging. Quite nice. the problem is that I cannot
figure out where to initialize the logger.
I spoke to Tom Schindl on platform.rcp mail list and he recommended to
ask here. How do I initialize my plug-in as early as possible, so that
even if there are some errors during initliazing of the workbench, for
example, they are being logged anyway?
Thanks very much in advance.
Re: early start of log service [message #83234 is a reply to message #83208] Tue, 13 February 2007 16:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

This is a multi-part message in MIME format.
--------------050600080703030302020100
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I tried to do like here:
http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02208.html
My interpretation is explained by the attached files. What am I doing wrong?
My activator class is being activated, but the class ILogActivator is
not... Breakpoint does not work when I add it in a default constructor. :-(
Peter Osipov wrote:
> Hello everybody!
> I am using log4j for logging. Quite nice. the problem is that I cannot
> figure out where to initialize the logger.
> I spoke to Tom Schindl on platform.rcp mail list and he recommended to
> ask here. How do I initialize my plug-in as early as possible, so that
> even if there are some errors during initliazing of the workbench, for
> example, they are being logged anyway?
> Thanks very much in advance.


--------------050600080703030302020100
Content-Type: text/plain;
name="MANIFEST.MF"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="MANIFEST.MF"

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.apache.log4j
Bundle-Version: 1.2.13
Bundle-ClassPath: log4j-1.2.13.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.apache.log4j,
org.apache.log4j.chainsaw,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jdbc,
org.apache.log4j.jmx,
org.apache.log4j.lf5,
org.apache.log4j.lf5.config,
org.apache.log4j.lf5.util,
org.apache.log4j.lf5.viewer,
org.apache.log4j.lf5.viewer.categoryexplorer,
org.apache.log4j.lf5.viewer.configure,
org.apache.log4j.lf5.viewer.images,
org.apache.log4j.net,
org.apache.log4j.nt,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.or.sax,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml
Import-Package: org.osgi.framework, org.osgi.service.component
Require-Bundle: org.eclipse.osgi, org.eclipse.osgi.services, org.eclipse.core.runtime
Bundle-Activator: com.astrac.as.client.logging.Activator
Service-Component: /activator.xml
Eclipse-LazyStart: true

--------------050600080703030302020100
Content-Type: text/plain;
name="Activator.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Activator.java"

package com.astrac.as.client.logging;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;


/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin
{

// The plug-in ID
public static final String PLUGIN_ID = "org.apache.log4j";

// The shared instance
private static Activator plugin;

/**
* The constructor
*/
public Activator()
{
plugin = this;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.Bu ndleContext)
*/
public void start(BundleContext context) throws Exception
{
super.start(context);
return;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.Bund leContext)
*/
public void stop(BundleContext context) throws Exception
{
plugin = null;
super.stop(context);
}

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault()
{
return plugin;
}

}

--------------050600080703030302020100
Content-Type: text/plain;
name="ILogActivator.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ILogActivator.java"

package com.astrac.as.client.logging;

public interface ILogActivator
{
void activate();
}

--------------050600080703030302020100
Content-Type: text/plain;
name="ILogActivatorImpl.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ILogActivatorImpl.java"

package com.astrac.as.client.logging;

public class ILogActivatorImpl implements ILogActivator
{
public ILogActivatorImpl()
{
return;
}
public void activate()
{
return;
}

}

--------------050600080703030302020100--
Re: early start of log service [message #83260 is a reply to message #83234] Tue, 13 February 2007 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Well the only difference I could see is in the Activator class line on
this line in that example:<br>
Import-Package: org.osgi.framework, <b>org.eclipse.equinox.ds</b>,
org.osgi.service.component<br>
I did not import the package in bold, because I could not find it in my
workspace and secondly I could not find the reason to inlclude it. It
is being imported in that example, but not being used, so to speak<br>
Peter Osipov wrote:
<blockquote cite="mideqsnd3$flm$1@utils.eclipse.org" type="cite">I
tried to do like here:
<br>
<a class="moz-txt-link-freetext" href=" http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02208.html"> http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02208.html</a>
<br>
My interpretation is explained by the attached files. What am I doing
wrong?
<br>
My activator class is being activated, but the class ILogActivator is
not... Breakpoint does not work when I add it in a default constructor.
:-(
<br>
Peter Osipov wrote:
<br>
<blockquote type="cite">Hello everybody!
<br>
I am using log4j for logging. Quite nice. the problem is that I cannot
figure out where to initialize the logger.
<br>
I spoke to Tom Schindl on platform.rcp mail list and he recommended to
ask here. How do I initialize my plug-in as early as possible, so that
even if there are some errors during initliazing of the workbench, for
example, they are being logged anyway?
<br>
Thanks very much in advance.
<br>
</blockquote>
<br>
<pre wrap="">
<hr size="4" width="90%">
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.apache.log4j
Bundle-Version: 1.2.13
Bundle-ClassPath: log4j-1.2.13.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.apache.log4j,
org.apache.log4j.chainsaw,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jdbc,
org.apache.log4j.jmx,
org.apache.log4j.lf5,
org.apache.log4j.lf5.config,
org.apache.log4j.lf5.util,
org.apache.log4j.lf5.viewer,
org.apache.log4j.lf5.viewer.categoryexplorer,
org.apache.log4j.lf5.viewer.configure,
org.apache.log4j.lf5.viewer.images,
org.apache.log4j.net,
org.apache.log4j.nt,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.or.sax,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml
Import-Package: org.osgi.framework, org.osgi.service.component
Require-Bundle: org.eclipse.osgi, org.eclipse.osgi.services, org.eclipse.core.runtime
Bundle-Activator: com.astrac.as.client.logging.Activator
Service-Component: /activator.xml
Eclipse-LazyStart: true
</pre>
<pre wrap="">
<hr size="4" width="90%">
package com.astrac.as.client.logging;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;


/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin
{

// The plug-in ID
public static final String PLUGIN_ID = "org.apache.log4j";

// The shared instance
private static Activator plugin;

/**
* The constructor
*/
public Activator()
{
plugin = this;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.Bu ndleContext)
*/
public void start(BundleContext context) throws Exception
{
super.start(context);
return;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.Bund leContext)
*/
public void stop(BundleContext context) throws Exception
{
plugin = null;
super.stop(context);
}

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault()
{
return plugin;
}

}
</pre>
<pre wrap="">
<hr size="4" width="90%">
package com.astrac.as.client.logging;

public interface ILogActivator
{
void activate();
}
</pre>
<pre wrap="">
<hr size="4" width="90%">
package com.astrac.as.client.logging;

public class ILogActivatorImpl implements ILogActivator
{
public ILogActivatorImpl()
{
return;
}
public void activate()
{
return;
}

}
</pre>
</blockquote>
<br>
</body>
</html>
Re: early start of log service [message #83272 is a reply to message #83260] Tue, 13 February 2007 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Not in the activator class, but in MANIFEST.MF file. Sorry.<br>
Peter Osipov wrote:
<blockquote cite="mideqsnj5$flm$2@utils.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Well the only difference I could see is<b> <font color="#ff0000">in
the Activator class</font></b> line on
this line in that example:<br>
Import-Package: org.osgi.framework, <b>org.eclipse.equinox.ds</b>,
org.osgi.service.component<br>
I did not import the package in bold, because I could not find it in my
workspace and secondly I could not find the reason to inlclude it. It
is being imported in that example, but not being used, so to speak<br>
Peter Osipov wrote:
<blockquote cite="mideqsnd3$flm$1@utils.eclipse.org" type="cite">I
tried to do like here: <br>
<a class="moz-txt-link-freetext"
href=" http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02208.html"> http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg02208.html</a>
<br>
My interpretation is explained by the attached files. What am I doing
wrong? <br>
My activator class is being activated, but the class ILogActivator is
not... Breakpoint does not work when I add it in a default constructor.
:-( <br>
Peter Osipov wrote: <br>
<blockquote type="cite">Hello everybody! <br>
I am using log4j for logging. Quite nice. the problem is that I cannot
figure out where to initialize the logger. <br>
I spoke to Tom Schindl on platform.rcp mail list and he recommended to
ask here. How do I initialize my plug-in as early as possible, so that
even if there are some errors during initliazing of the workbench, for
example, they are being logged anyway? <br>
Thanks very much in advance. <br>
</blockquote>
<br>
<pre wrap=""><hr size="4" width="90%">
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.apache.log4j
Bundle-Version: 1.2.13
Bundle-ClassPath: log4j-1.2.13.jar
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.apache.log4j,
org.apache.log4j.chainsaw,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jdbc,
org.apache.log4j.jmx,
org.apache.log4j.lf5,
org.apache.log4j.lf5.config,
org.apache.log4j.lf5.util,
org.apache.log4j.lf5.viewer,
org.apache.log4j.lf5.viewer.categoryexplorer,
org.apache.log4j.lf5.viewer.configure,
org.apache.log4j.lf5.viewer.images,
org.apache.log4j.net,
org.apache.log4j.nt,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.or.sax,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml
Import-Package: org.osgi.framework, org.osgi.service.component
Require-Bundle: org.eclipse.osgi, org.eclipse.osgi.services, org.eclipse.core.runtime
Bundle-Activator: com.astrac.as.client.logging.Activator
Service-Component: /activator.xml
Eclipse-LazyStart: true
</pre>
<pre wrap=""><hr size="4" width="90%">
package com.astrac.as.client.logging;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;


/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin
{

// The plug-in ID
public static final String PLUGIN_ID = "org.apache.log4j";

// The shared instance
private static Activator plugin;

/**
* The constructor
*/
public Activator()
{
plugin = this;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.Bu ndleContext)
*/
public void start(BundleContext context) throws Exception
{
super.start(context);
return;
}

/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.Bund leContext)
*/
public void stop(BundleContext context) throws Exception
{
plugin = null;
super.stop(context);
}

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault()
{
return plugin;
}

}
</pre>
<pre wrap=""><hr size="4" width="90%">
package com.astrac.as.client.logging;

public interface ILogActivator
{
void activate();
}
</pre>
<pre wrap=""><hr size="4" width="90%">
package com.astrac.as.client.logging;

public class ILogActivatorImpl implements ILogActivator
{
public ILogActivatorImpl()
{
return;
}
public void activate()
{
return;
}

}
</pre>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>
Previous Topic:Behavor change from version 3.2.1 to 3.3M4. Regression?
Next Topic:Problems by JSF/JSTL Examples ServerSide
Goto Forum:
  


Current Time: Fri Apr 26 04:56:25 GMT 2024

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

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

Back to the top