Re: [pag-logging] Is it possible to completely turn off logging?

2017-03-30 Thread Matt Sicker
Log4j2 supports the "OFF" level which is higher than "FATAL" effectively
disabling logging. I'm not sure if there's an equivalent in v1 or Logback.

On 30 March 2017 at 14:53, 'Achim Nierbeck' via OPS4J <
ops4j@googlegroups.com> wrote:

> Well if you only install the api bundle you don't have any logging as that
> is only the API bundle.
> The implementation and the actual logging is done from the service bundle.
>
> regarding NONE beeing a bug, I doubt that this is a bug.
> Pax Logging just leverages different logging apis to one provider (log4j2,
> with the latest one)
> afaik none of the logging frameworks I'm aware of right now does have a
> log level NONE (might be wrong on that, but never seen it or used it)
> Usually if you don't want to log a certain class or certain packages
> exclude those.
>
> take a look at the log4j project for details [1]
>
> regards, Achim
>
> [1] - https://logging.apache.org/log4j/2.x/manual/
> configuration.html#Loggers
>
>
> 2017-03-30 11:22 GMT+02:00 Pavel :
>
>> However, I have noticed that when I add to my project only
>> pax-logging-api such problem doesn't appear.
>>
>> However, when I add also pax-logging-service such problem appears.
>>
>> After reading the source code it seems that it is bug in
>> org.ops4j.pax.logging.service.internal.PaxLoggingServiceImpl in method
>> convertLevel.
>> There is no condition when levelName=NONE.
>>
>> See this code
>>
>> if( m_bundleContext == null )
>> {
>> levelName = System.getProperty( DEFAULT_SERVICE_LOG_LEVEL,
>> "DEBUG" ).trim();
>> }
>> else
>> {
>> levelName = m_bundleContext.getProperty(
>> DEFAULT_SERVICE_LOG_LEVEL );
>> if( levelName == null )
>> {
>> levelName = "DEBUG";
>> }
>> else
>> {
>> levelName = levelName.trim();
>> }
>> }
>> m_logLevel = convertLevel( levelName );
>>  .
>>
>> private static int convertLevel( String levelName )
>> {
>> if( "DEBUG".equals( levelName ) )
>> {
>> return LOG_DEBUG;
>> }
>> else if( "INFO".equals( levelName ) )
>> {
>> return LOG_INFO;
>> }
>> else if( "ERROR".equals( levelName ) )
>> {
>> return LOG_ERROR;
>> }
>> else if( "WARN".equals( levelName ) )
>> {
>> return LOG_WARNING;
>> }
>> else
>> {
>> return LOG_DEBUG;
>> }
>> }
>>
>>
>> четверг, 30 марта 2017 г., 11:42:33 UTC+3 пользователь Achim Nierbeck
>> написал:
>>>
>>> Hi Pavel,
>>>
>>> I doubt the log providers used by Pax-Logging support this concept of
>>> "disabling" the logging this way.
>>> Usually you just don't define an appender, if no appender no output :)
>>>
>>> Regards, Achim
>>>
>>> 2017-03-29 16:24 GMT+02:00 Pavel :
>>>
 Hi all.

 I have the following problem. When I set
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=ERROR - I get
 error level
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=DEBUG - I get
 debug level
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=INFO - I get info
 level
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN - I get warn
 level

 However, when I set
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=NONE - I get debug
 level
 -Dorg.ops4j.pax.logging.DefaultServiceLog.level=OFF - I get debug
 level.

 I tried with pax-logging-ap 1.8.5 and 1.9.1. result is the same.

 Could anyone say how logging from API can be completely turned off?

 Best regards, Pavel

 --
 --
 --
 OPS4J - http://www.ops4j.org - op...@googlegroups.com

 ---
 You received this message because you are subscribed to the Google
 Groups "OPS4J" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to ops4j+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> --
>>>
>>> Apache Member
>>> Apache Karaf  Committer & PMC
>>> OPS4J Pax Web  Committer
>>> & Project Lead
>>> blog 
>>> Co-Author of Apache Karaf Cookbook 
>>>
>>> Software Architect / Project Manager / Scrum Master
>>>
>>> --
>> --
>> --
>> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ops4j+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Apache Member
> Apache Karaf 

trouble with Maven Central's suggested dependency resolution for pax-web-api on javax.servlet-api

2017-03-30 Thread Trace Windham
I'm trying to manually load bundles one at a time into an instance of 
Knopflerfish 6.1.0 running on my Windows 7 desktop.

I'm using the bundles found at Maven Central, because Maven Central 
provides me with a list of bundles that each bundle depends on in the 
"Provided Dependencies" section of each bundles web page on Maven Central.

When I try to install the bundle pax-web-api found 
here... https://mvnrepository.com/artifact/org.ops4j.pax.web/pax-web-api/6.0.3

I get this error...  

[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable:
[stderr] org.osgi.framework.BundleException: Bundle#36, unable to resolve: 
Missing package(s) or can not resolve all of the them:
javax.servlet.annotation;version=[2.3.0,4.0.0) -- Provider rejected because 
of uses directive  - javax.servlet.annotation;version=3.1.0 Bundle[id=37,gen
=0].
[stderr]at org.knopflerfish.framework.BundleImpl.getUpdatedState(
BundleImpl.java:1278)
[stderr]at org.knopflerfish.framework.BundleImpl.finalizeActivation(
BundleImpl.java:311)
[stderr]at org.knopflerfish.framework.PermissionOps.
callFinalizeActivation(PermissionOps.java:269)
[stderr]at org.knopflerfish.framework.BundleImpl.start(BundleImpl.
java:294)
[stderr]at org.knopflerfish.bundle.desktop.swing.Desktop$36.run(
Desktop.java:2666)

The bundle being used that exports the javax.servlet.annotation package is 
the one I found on that same Maven Central page I linked to earlier in the 
Provided Dependencies section called, javax.servlet-api.  I'm using version 
3.1.0 that I found 
here... https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api/3.1.0

Is there another bundle that exports the javax.servlet.annotation package 
that will satisfy the needs of the pax-web-api bundle?

Thanks,
Trace Windham


-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "Getting Started" Documentation Availability

2017-03-30 Thread Trace Windham
I'm not sure what those unit tests are supposed to be helping me with.

What I'm looking for is a "Hello World" type of instructions that I can get 
up and running with.  

I would assume that it would include the following: 

1. A list of bundles that I have to add to a brand new instance of 
Knopflerfish.  
2. Any changes that I need to make to Knopflerfish in order to insure that 
any servlets registered would be served using Jetty.
3. A Hello World bundle that I could deploy that would consist of a servlet 
that runs and presents a Hello World response when requested through a 
browser.

So far, I'm trying to figure out the first item on my list above by adding 
all of these bundles to my Knopflerfish instance running on my development 
machine: (o.o.pax.web.pax-web-jetty-bundle, o.o.pax.web.pax-web-jsp, 
o.o.pax.web.pax-web-extender-war, o.o.pax.logging.pax-logging-api, 
o.o.pax.web.pax-web-spi, o.o.pax.web.pax-web-api, 
org.apache.xbean.bundleutils, org.apache.xbean.finder, org.objectweb.asm, 
org.ojectweb.asm.commons, org.objectweb.asm.tree, com.sun.el.javax.el, 
o.o.pax.web.pax-web-descriptor).

I came up with this list of bundles by just trying to add pax-web-jetty 
bundles to my Knopflerfish, and receiving errors such as: dependency 
errors, class not found errors, class cast exceptions, etc.  I still don't 
have the correct list of bundles successfully running in my Knopflerfish. 
 I'm hoping there is a better way to get pax-web-jetty running in an 
instance of Knopflerfish than what I'm currently doing.

Thanks for your time,
Trace Windham



On Wednesday, March 29, 2017 at 10:31:24 AM UTC-5, Achim Nierbeck wrote:
>
> Hi Trace, 
>
> I'd say the easiest way of finding a successful runtime will be to take a 
> look at the Pax Web Integration tests. [1]
> In your case I'd try to focus on [2], as you seem to use the 
> "all-in-one-bundle" right now. 
> The important part will lye in the base test class [3].
> From there on you'll need to find out what kind of bundle setup fits best 
> your embedded scenario and strip that down. 
>
> regards, Achim 
>
> [1] - 
> https://github.com/ops4j/org.ops4j.pax.web/tree/master/pax-web-itest/pax-web-itest-container/pax-web-itest-container-jetty/src/test/java/org/ops4j/pax/web/itest/jetty
> [2] - 
> https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-itest/pax-web-itest-container/pax-web-itest-container-jetty/src/test/java/org/ops4j/pax/web/itest/jetty/JettyBundleIntegrationTest.java
> [3] - 
> https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-itest/pax-web-itest-container/pax-web-itest-container-jetty/src/test/java/org/ops4j/pax/web/itest/jetty/ITestBase.java#L87-L94
>
>
>
> 2017-03-29 17:20 GMT+02:00 Trace Windham 
> :
>
>> I've been thrown into a task involving pax-web-jetty, so forgive my 
>> ignorance.
>>
>> My employer runs an instance of pax-web-jetty verson 4.1.0 on an embedded 
>> device which runs the Knopflerfish OSGi container.
>>
>> I've been tasked with investigating the possibility of upgrading to the 
>> latest versions of each of these tools.  
>>
>> To start, I thought I would get an instance of Knopflerfish 6.1.0 up and 
>> running on my development machine, since it's much easier to configure 
>> things there instead of our embedded device.
>>
>> That was pretty easy.
>>
>> Then I wanted to add the pax-web-jetty bundles up and running.
>>
>> All I have found so far is this old tutorial that seems to be out of date 
>> for the current versions of pax-web-jetty and Knopflerfish.  
>> http://www.knopflerfish.org/kf_pax_web_tutorial.html
>>
>> Can anyone point me to a more up to date tutorial that will allow me to 
>> use the pax-web-jetty bundles in Knopflerfish successfully?
>>
>> Thanks,
>> Trace
>>
>> -- 
>> -- 
>> --
>> OPS4J - http://www.ops4j.org - op...@googlegroups.com 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ops4j+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer & 
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
>
> Software Architect / Project Manager / Scrum Master 
>
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pag-logging] Is it possible to completely turn off logging?

2017-03-30 Thread Pavel
Hi Achim,

Thank you very much for your answer.

Best regards, Pavel

четверг, 30 марта 2017 г., 11:42:33 UTC+3 пользователь Achim Nierbeck 
написал:
>
> Hi Pavel, 
>
> I doubt the log providers used by Pax-Logging support this concept of 
> "disabling" the logging this way. 
> Usually you just don't define an appender, if no appender no output :) 
>
> Regards, Achim 
>
> 2017-03-29 16:24 GMT+02:00 Pavel :
>
>> Hi all.
>>
>> I have the following problem. When I set 
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=ERROR - I get error 
>> level
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=DEBUG - I get debug 
>> level
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=INFO - I get info 
>> level
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN - I get warn 
>> level
>>
>> However, when I set
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=NONE - I get debug 
>> level
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=OFF - I get debug 
>> level.
>>
>> I tried with pax-logging-ap 1.8.5 and 1.9.1. result is the same.
>>
>> Could anyone say how logging from API can be completely turned off? 
>>
>> Best regards, Pavel
>>
>> -- 
>> -- 
>> --
>> OPS4J - http://www.ops4j.org - op...@googlegroups.com 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ops4j+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Apache Member
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer & 
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
>
> Software Architect / Project Manager / Scrum Master 
>
>

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pag-logging] Is it possible to completely turn off logging?

2017-03-30 Thread 'Achim Nierbeck' via OPS4J
Hi Pavel,

I doubt the log providers used by Pax-Logging support this concept of
"disabling" the logging this way.
Usually you just don't define an appender, if no appender no output :)

Regards, Achim

2017-03-29 16:24 GMT+02:00 Pavel :

> Hi all.
>
> I have the following problem. When I set
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=ERROR - I get error
> level
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=DEBUG - I get debug
> level
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=INFO - I get info
> level
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN - I get warn
> level
>
> However, when I set
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=NONE - I get debug
> level
> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=OFF - I get debug
> level.
>
> I tried with pax-logging-ap 1.8.5 and 1.9.1. result is the same.
>
> Could anyone say how logging from API can be completely turned off?
>
> Best regards, Pavel
>
> --
> --
> --
> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ops4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Apache Member
Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
blog 
Co-Author of Apache Karaf Cookbook 

Software Architect / Project Manager / Scrum Master

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Release of pax-jdbc 1.1.0

2017-03-30 Thread Christian Schneider

Pax-jdbc 1.1.0 is released which fixes these issues:

https://ops4j1.jira.com/browse/PAXJDBC-123?jql=project%20%3D%20PAXJDBC%20AND%20fixVersion%20%3D%201.1.0

Highlights:

- Update of some database versions

- Support for database migration or setup hook (PreHook). The user can 
publish such a service and


refer to it in the config. This service is then called before the 
DataSource is published as a service.



Christian


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

--
--
--
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups "OPS4J" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.