[ 
http://issues.ops4j.org/browse/PAXLOGGING-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020#action_13020
 ] 

Niclas Hedhman commented on PAXLOGGING-54:
------------------------------------------

The main issue is that the only way I know on how to obtain the caller is via 
the stack trace in Throwable. For 1.4, this has to be done with;

Throwable t = new Throwable();
t.fillInStackTrace();
StackTraceElement[] stack = t.getStackTrace();

But the StackTraceElement only contains the Class name, and not the class 
itself.

So, unless someone else can come up with a way to find the java.lang.Class of 
the caller, I won't implement the alternative; i.e. try to figure out which 
Bundle that the class may belong to, since not only is it needed to figure out 
the class space resolution of OSGi, but also the caller may be an internal 
class and potentially there is no public exposure to where the class comes from.

There are two alternatives that can work for "native bundles" (i.e. code that 
is OSGi aware);

 a. Add a Pax Logging specific method to LogFactory, getLog( String category, 
Bundle bundle ), OR

 b. Make Pax Logging an embedded system instead, i.e. the API must be placed 
into the client bundle, and initialized from that bundle's activator. (It is 
likely that this already works...)


Otherwise, I am out of ideas on how to tackle this.

> Wrong log event source if we use the LogReaderService.
> ------------------------------------------------------
>
>                 Key: PAXLOGGING-54
>                 URL: http://issues.ops4j.org/browse/PAXLOGGING-54
>             Project: Pax Logging
>          Issue Type: Bug
>    Affects Versions: 1.3.0
>         Environment: win32, JDK1.6, Eclipse 3.3
>            Reporter: Frank K.
>            Assignee: Niclas Hedhman
>
> All log entries which was logged to commons.logging and collected form the 
> LogReaderService have the wrong  event source. All events have the same 
> source the org.ops4j.pax.logging.pax-logging-api bundle.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to