You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Christopher BROWN <br...@reflexe.fr> on 2013/09/16 18:50:47 UTC

Changing Felix log level at runtime

Hi,

I provide my own implementation of the Felix logger (I'm not referring the
OSGi log service here, I'm aware of the difference).  I set it up using the
HashMap I provided to the Felix constructor (I'm using Felix in embedded
mode), using the two following properties:

FelixConstants.LOG_LEVEL_PROP
FelixConstants.LOG_LOGGER_PROP

It all works fine.  However, once constructed, I can't see anyway to change
the log level at runtime.  The use case involves starting in INFO or
WARNING level, and briefly setting it to DEBUG before returning to the
previous (less verbose) setting.

Is this possible?

Thanks,
Christopher

Re: Changing Felix log level at runtime

Posted by Christopher BROWN <br...@reflexe.fr>.
So do I, when I looked in the correct place...  Works fine, so thanks!

--
Christopher



On 16 September 2013 20:02, Richard S. Hall <he...@ungoverned.org> wrote:

> On 9/16/13 12:50 , Christopher BROWN wrote:
>
>> Hi,
>>
>> I provide my own implementation of the Felix logger (I'm not referring the
>> OSGi log service here, I'm aware of the difference).  I set it up using
>> the
>> HashMap I provided to the Felix constructor (I'm using Felix in embedded
>> mode), using the two following properties:
>>
>> FelixConstants.LOG_LEVEL_PROP
>> FelixConstants.LOG_LOGGER_PROP
>>
>> It all works fine.  However, once constructed, I can't see anyway to
>> change
>> the log level at runtime.  The use case involves starting in INFO or
>> WARNING level, and briefly setting it to DEBUG before returning to the
>> previous (less verbose) setting.
>>
>> Is this possible?
>>
>
> I see a Logger.setLogLevel() method...
>
> If you've created the logger, then you should have a reference to it.
>
> -> richard
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<us...@felix.apache.org>
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Changing Felix log level at runtime

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 9/16/13 12:50 , Christopher BROWN wrote:
> Hi,
>
> I provide my own implementation of the Felix logger (I'm not referring the
> OSGi log service here, I'm aware of the difference).  I set it up using the
> HashMap I provided to the Felix constructor (I'm using Felix in embedded
> mode), using the two following properties:
>
> FelixConstants.LOG_LEVEL_PROP
> FelixConstants.LOG_LOGGER_PROP
>
> It all works fine.  However, once constructed, I can't see anyway to change
> the log level at runtime.  The use case involves starting in INFO or
> WARNING level, and briefly setting it to DEBUG before returning to the
> previous (less verbose) setting.
>
> Is this possible?

I see a Logger.setLogLevel() method...

If you've created the logger, then you should have a reference to it.

-> richard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org