No. I don't use karaf. I use only two bundles - pax-logging-api and 
pax-logging-service. Besides, I don't have org.ops4j.pax.logging.cfg file 
and
I don't configure pax-logging-service manually via ManagedService.

The problem is here:
 
https://github.com/ops4j/org.ops4j.pax.logging/blob/master/pax-logging-service/src/main/java/org/ops4j/pax/logging/service/internal/PaxLoggingServiceImpl.java#L384
 


Why? Because when only pax-logging-api bundle is used, then it reads 
org.ops4j.pax.logging.DefaultServiceLog.level
from system properties and sets level to NONE.

However, when pax-logging-service is also used then in 
PaxLoggingServiceImpl (see the link above) it changes level from NONE to 
DEBUG.

пятница, 31 марта 2017 г., 11:30:41 UTC+3 пользователь Guillaume Nodet 
написал:
>
> Are you using Karaf ?  I have the setting to debug in 
> etc/system.properties by default, so I had to change it.  Make sure your 
> config does not override the default.
> Note that this only affect the osgi log service log level, not the usual 
> backend config.
>
> 2017-03-31 9:15 GMT+02:00 Pavel <[email protected] <javascript:>>:
>
>> I've just tested. No, the fix didn't help. 
>>
>> I use two bundles - pax-logging-api and pax-logging-service and I set 
>> -Dorg.ops4j.pax.logging.DefaultServiceLog.level=NONE and in result I get 
>> debug level.
>>
>> Maybe the problem in level mismatch is that 
>> https://osgi.org/javadoc/r4v42/org/osgi/service/log/LogService.html 
>> doesn't have NONE/OFF levels?
>>
>> пятница, 31 марта 2017 г., 9:57:35 UTC+3 пользователь Guillaume Nodet 
>> написал:
>>>
>>> The problem raised by Pavel is actually on the default logger.  I 
>>> haven't tested, but I think the configuration for each backend will already 
>>> support OFF or NONE, depending on the provider.  It just needs to be 
>>> configured correctly.
>>>
>>> For the default logger, some stuff was missing, I've committed a fix:
>>>
>>> https://github.com/ops4j/org.ops4j.pax.logging/commit/71aac7ef3f628a8923e5d1b5e6955923967b44eb
>>>
>>> Pavel, let me know if this works for you.
>>>
>>> 2017-03-31 8:52 GMT+02:00 'Achim Nierbeck' via OPS4J <
>>> [email protected]>:
>>>
>>>> In that case we have a bug that we don't forward this to the underlying 
>>>> implementations. 
>>>>
>>>> Someone just needs to file a bug in JIRA and we need a patch :D
>>>>
>>>> regards, Achim 
>>>>
>>>>
>>>> 2017-03-31 8:16 GMT+02:00 Guillaume Nodet <[email protected]>:
>>>>
>>>>> It seems log4j, log4j2 and logback have some support for OFF.
>>>>>
>>>>> 2017-03-30 23:05 GMT+02:00 Matt Sicker <[email protected]>:
>>>>>
>>>>>> 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 <
>>>>>> [email protected]> 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 <[email protected]>:
>>>>>>>
>>>>>>>> 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 <[email protected]>:
>>>>>>>>>
>>>>>>>>>> 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 - [email protected]
>>>>>>>>>>
>>>>>>>>>> --- 
>>>>>>>>>> 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 [email protected].
>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>>>
>>>>>>>>> Apache Member
>>>>>>>>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>>>>>>>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
>>>>>>>>> Committer & Project Lead
>>>>>>>>> blog <http://notizblog.nierbeck.de/>
>>>>>>>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>>>>>>>>
>>>>>>>>> Software Architect / Project Manager / Scrum Master 
>>>>>>>>>
>>>>>>>>> -- 
>>>>>>>> -- 
>>>>>>>> ------------------
>>>>>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>>>>>
>>>>>>>> --- 
>>>>>>>> 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 [email protected].
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>>
>>>>>>> Apache Member
>>>>>>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>>>>>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
>>>>>>> Committer & Project Lead
>>>>>>> blog <http://notizblog.nierbeck.de/>
>>>>>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>>>>>>
>>>>>>> Software Architect / Project Manager / Scrum Master 
>>>>>>>
>>>>>>> -- 
>>>>>>> -- 
>>>>>>> ------------------
>>>>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>>>>
>>>>>>> --- 
>>>>>>> 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 [email protected].
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> Matt Sicker <[email protected]>
>>>>>>
>>>>>> -- 
>>>>>> -- 
>>>>>> ------------------
>>>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>>>
>>>>>> --- 
>>>>>> 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 [email protected].
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> ------------------------
>>>>> Guillaume Nodet
>>>>>
>>>>> -- 
>>>>> -- 
>>>>> ------------------
>>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>>
>>>>> --- 
>>>>> 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 [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>>
>>>> Apache Member
>>>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
>>>> Committer & Project Lead
>>>> blog <http://notizblog.nierbeck.de/>
>>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>>>
>>>> Software Architect / Project Manager / Scrum Master 
>>>>
>>>> -- 
>>>> -- 
>>>> ------------------
>>>> OPS4J - http://www.ops4j.org - [email protected]
>>>>
>>>> --- 
>>>> 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 [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> ------------------------
>>> Guillaume Nodet
>>>
>>> -- 
>> -- 
>> ------------------
>> OPS4J - http://www.ops4j.org - [email protected] <javascript:>
>>
>> --- 
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> ------------------------
> Guillaume Nodet
>
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to