Re: [osgi-dev] Enabling debug of SCR with Equinox

2018-08-08 Thread Cristiano via osgi-dev

Hi Raymond,

Well, I use old and good PDE (plus maven) and I can confirm and 
reconfirm that empirically the difference of number of lines displayed 
between the 2 cases is huge.


In case one, I just start the framework setting the felix.logback to 
auto-start. so, have no change in the default start level (4);


In case two, I set it to auto-start and and set the start level to 1.

Then, after bootstrap have occurred I copied the console text to a text 
editor in order to count the lines.


In case one I had 119 lines while in the case two I had 850 lines !

Investigating, when you create a run configuration normally the SCR is 
automatically set to have start-level 2. If we don't set the 
felix.logback to start before SCR then all the itens logged by SCR will 
be missed. And was what happened.


best regards,

Cristiano


On 07/08/2018 10:24, Raymond Auge wrote:
You don't need to use start levels at all if you place felix.logback 
onto the classpath of the framework. For equinox see [3] and for felix 
(you need the org.apache.felix.log.extension bundle installed) see [2].




___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] Enabling debug of SCR with Equinox

2018-08-07 Thread Alain Picard via osgi-dev
Thanks Ray and Cristiano. will try that shortly.

Alain


On Tue, Aug 7, 2018 at 9:24 AM Raymond Auge via osgi-dev <
osgi-dev@mail.osgi.org> wrote:

> Here's a few additional comments to Critiano's suggestion:
>
>
> On Mon, Aug 6, 2018 at 8:38 PM, Cristiano via osgi-dev <
> osgi-dev@mail.osgi.org> wrote:
>
>> hi,
>>
>> if you are using the latest equinox, one good alternative is to use the
>> recently released org.apache.felix.logback.
>>
> You can even use it now with the latest Felix + latest Felix Log Service
> (1.2.0).
>
> See these integration tests [1] & [2]
>
>>
>> you just need to set a proper logback configuration file defining the
>> appenders and log level and then use the vm argument as below (I used to
>> debug inside eclipse ide):
>>
>> -Dlogback.configurationFile=${workspace_loc:your_project}/logback-test.xml
>>
>>
>> Also, it is better to set org.apache.felix.logback's start level to one,
>> so you won't miss any log entry.
>>
>
> You don't need to use start levels at all if you place felix.logback onto
> the classpath of the framework. For equinox see [3] and for felix (you need
> the org.apache.felix.log.extension bundle installed) see [2].
>
> Sincerely,
> - Ray
>
> [1]
> https://github.com/apache/felix/blob/trunk/logback/itests/standard-felix-logservice/itest.bndrun
> [2]
> https://github.com/apache/felix/blob/trunk/logback/itests/immediate-felix-logservice/itest.bndrun
> [3]
> https://github.com/apache/felix/blob/trunk/logback/itests/immediate-equinox-logservice/itest.bndrun
>
>
>
>> See an example:
>>
>> 21:23:29,959 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
>> Setting level of logger [Events.Service.org.eclipse.osgi] to DEBUG
>>
>> 21:36:13||DEBUG|bundle org.apache.felix.scr:2.1.2 (20)bundle
>> org.eclipse.equinox.console:1.3.0.v20180119-0630 (22) : Starting extension
>> synchronously|L.org.apache.felix.scr||L.o.a.f.scr@?[main]
>>
>> 21:36:13||INFO|BundleEvent
>> STARTED|E.B.o.e.equinox.console||E.B.o.e.e.console@?[Framework Event
>> Dispatcher: Equinox Container: f558dbee-500a-4400-ae8a-0e68b1b46f2e]
>>
>> 21:36:18||DEBUG|ServiceEvent MODIFIED
>> {org.osgi.service.component.runtime.ServiceComponentRuntime}={service.changecount=19,
>> service.id=39, service.bundleid=20,
>> service.scope=singleton}|E.S.org.apache.felix.scr||E.S.o.a.f.scr@
>> ?[Timer-1]
>>
>>
>>
>
>>
>> regards,
>>
>> Cristiano
>>
>>
>> On 06/08/2018 12:28, Alain Picard via osgi-dev wrote:
>>
>> I want to enable debug logging / tracing of SCR when running with
>> Equinox. I tried to use config admin to configure
>> "org.apache.felix.scr.ScrService" but to no avail. Not sure if even if
>> Eclipse now uses felix scr if that is the way to go. Or it is the whole log
>> redirection thing (https://io7m.com/documents/brutal-felix-logging/).
>> Just looking for console debug.
>>
>> Thanks
>> Alain
>>
>>
>>
>> ___
>> OSGi Developer Mail 
>> listosgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>
>
>
> --
> *Raymond Augé* 
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* 
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance 
> (@OSGiAlliance)
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Enabling debug of SCR with Equinox

2018-08-07 Thread Raymond Auge via osgi-dev
Here's a few additional comments to Critiano's suggestion:


On Mon, Aug 6, 2018 at 8:38 PM, Cristiano via osgi-dev <
osgi-dev@mail.osgi.org> wrote:

> hi,
>
> if you are using the latest equinox, one good alternative is to use the
> recently released org.apache.felix.logback.
>
You can even use it now with the latest Felix + latest Felix Log Service
(1.2.0).

See these integration tests [1] & [2]

>
> you just need to set a proper logback configuration file defining the
> appenders and log level and then use the vm argument as below (I used to
> debug inside eclipse ide):
>
> -Dlogback.configurationFile=${workspace_loc:your_project}/logback-test.xml
>
>
> Also, it is better to set org.apache.felix.logback's start level to one,
> so you won't miss any log entry.
>

You don't need to use start levels at all if you place felix.logback onto
the classpath of the framework. For equinox see [3] and for felix (you need
the org.apache.felix.log.extension bundle installed) see [2].

Sincerely,
- Ray

[1]
https://github.com/apache/felix/blob/trunk/logback/itests/standard-felix-logservice/itest.bndrun
[2]
https://github.com/apache/felix/blob/trunk/logback/itests/immediate-felix-logservice/itest.bndrun
[3]
https://github.com/apache/felix/blob/trunk/logback/itests/immediate-equinox-logservice/itest.bndrun



> See an example:
>
> 21:23:29,959 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction -
> Setting level of logger [Events.Service.org.eclipse.osgi] to DEBUG
>
> 21:36:13||DEBUG|bundle org.apache.felix.scr:2.1.2 (20)bundle
> org.eclipse.equinox.console:1.3.0.v20180119-0630 (22) : Starting
> extension synchronously|L.org.apache.felix.scr||L.o.a.f.scr@?[main]
>
> 21:36:13||INFO|BundleEvent STARTED|E.B.o.e.equinox.
> console||E.B.o.e.e.console@?[Framework Event Dispatcher: Equinox
> Container: f558dbee-500a-4400-ae8a-0e68b1b46f2e]
>
> 21:36:18||DEBUG|ServiceEvent MODIFIED {org.osgi.service.component.runtime.
> ServiceComponentRuntime}={service.changecount=19, service.id=39,
> service.bundleid=20, service.scope=singleton}|E.S.
> org.apache.felix.scr||E.S.o.a.f.scr@?[Timer-1]
>
>
>

>
> regards,
>
> Cristiano
>
>
> On 06/08/2018 12:28, Alain Picard via osgi-dev wrote:
>
> I want to enable debug logging / tracing of SCR when running with Equinox.
> I tried to use config admin to configure "org.apache.felix.scr.ScrService"
> but to no avail. Not sure if even if Eclipse now uses felix scr if that is
> the way to go. Or it is the whole log redirection thing (
> https://io7m.com/documents/brutal-felix-logging/). Just looking for
> console debug.
>
> Thanks
> Alain
>
>
>
> ___
> OSGi Developer Mail 
> listosgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Enabling debug of SCR with Equinox

2018-08-06 Thread Cristiano via osgi-dev

hi,

if you are using the latest equinox, one good alternative is to use the 
recently released org.apache.felix.logback.


you just need to set a proper logback configuration file defining the 
appenders and log level and then use the vm argument as below (I used to 
debug inside eclipse ide):



-Dlogback.configurationFile=${workspace_loc:your_project}/logback-test.xml


Also, it is better to set org.apache.felix.logback's start level to one, 
so you won't miss any log entry.


See an example:

21:23:29,959 |-INFO in 
ch.qos.logback.classic.joran.action.LoggerAction - Setting level of 
logger [Events.Service.org.eclipse.osgi] to DEBUG
21:36:13||DEBUG|bundle org.apache.felix.scr:2.1.2 (20)bundle 
org.eclipse.equinox.console:1.3.0.v20180119-0630 (22) : Starting 
extension synchronously|L.org.apache.felix.scr||L.o.a.f.scr@?[main]


21:36:13||INFO|BundleEvent 
STARTED|E.B.o.e.equinox.console||E.B.o.e.e.console@?[Framework Event 
Dispatcher: Equinox Container: f558dbee-500a-4400-ae8a-0e68b1b46f2e]


21:36:18||DEBUG|ServiceEvent MODIFIED 
{org.osgi.service.component.runtime.ServiceComponentRuntime}={service.changecount=19, 
service.id=39, service.bundleid=20, 
service.scope=singleton}|E.S.org.apache.felix.scr||E.S.o.a.f.scr@?[Timer-1]



regards,

Cristiano

On 06/08/2018 12:28, Alain Picard via osgi-dev wrote:
I want to enable debug logging / tracing of SCR when running with 
Equinox. I tried to use config admin to configure 
"org.apache.felix.scr.ScrService" but to no avail. Not sure if even if 
Eclipse now uses felix scr if that is the way to go. Or it is the 
whole log redirection thing 
(https://io7m.com/documents/brutal-felix-logging/). Just looking for 
console debug.


Thanks
Alain



___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Enabling debug of SCR with Equinox

2018-08-06 Thread Alain Picard via osgi-dev
I want to enable debug logging / tracing of SCR when running with Equinox.
I tried to use config admin to configure "org.apache.felix.scr.ScrService"
but to no avail. Not sure if even if Eclipse now uses felix scr if that is
the way to go. Or it is the whole log redirection thing (
https://io7m.com/documents/brutal-felix-logging/). Just looking for console
debug.

Thanks
Alain
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev