You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Tomáš Šoltys <to...@gmail.com> on 2011/11/29 14:33:51 UTC
Set log level
Hi all,
Is there a way to change a broker log level from python script while
broker is running?
Thanks,
Tomas
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: Set log level
Posted by Tomáš Šoltys <to...@gmail.com>.
Thanks a lot. It works just as I wanted it to.
Tomas
On Wed, Nov 30, 2011 at 11:02 AM, Gordon Sim <gs...@redhat.com> wrote:
> On 11/30/2011 07:54 AM, Tomáš Šoltys wrote:
>>
>> Thanks Gordon,
>>
>> I prefer second option. But what I am really missing is the broker
>> method for changing the log level.
>>
>> Something like:
>>
>> Session().addBroker("user/pass@host:port", timeout).setLogLevel(DEBUG)
>>
>> Is there something like this?
>
>
> Not quite, but close. The following would work:
>
> import qmf.console
>
> ssn = qmf.console.Session()
> ssn.addBroker("localhost:5672")
> broker = ssn.getObjects(_class="broker")[0]
> broker.setLogLevel("debug+")
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
--
Tomáš Šoltys
tomas.soltys@gmail.com
http://www.range-software.com
(+420) 776-843-663
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: Set log level
Posted by Gordon Sim <gs...@redhat.com>.
On 11/30/2011 07:54 AM, Tomáš Šoltys wrote:
> Thanks Gordon,
>
> I prefer second option. But what I am really missing is the broker
> method for changing the log level.
>
> Something like:
>
> Session().addBroker("user/pass@host:port", timeout).setLogLevel(DEBUG)
>
> Is there something like this?
Not quite, but close. The following would work:
import qmf.console
ssn = qmf.console.Session()
ssn.addBroker("localhost:5672")
broker = ssn.getObjects(_class="broker")[0]
broker.setLogLevel("debug+")
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: Set log level
Posted by Tomáš Šoltys <to...@gmail.com>.
Thanks Gordon,
I prefer second option. But what I am really missing is the broker
method for changing the log level.
Something like:
Session().addBroker("user/pass@host:port", timeout).setLogLevel(DEBUG)
Is there something like this?
Thanks,
Tomas
On Tue, Nov 29, 2011 at 2:40 PM, Gordon Sim <gs...@redhat.com> wrote:
> On 11/29/2011 01:33 PM, Tomáš Šoltys wrote:
>>
>> Is there a way to change a broker log level from python script while
>> broker is running?
>
>
> Yes. One way is to use or emulate the qpid-ctrl script[1]. This was designed
> to run from the command line for testing the changing of log-level, e.g.
> qpid-ctrl -b localhost:$PORT setLogLevel level='debug+:Broker', but can
> actually be used to ionvoke any QMFv2 'method' on the broker.
>
> Alternatively you can use one of the QMF APIs. These aren't terribly well
> documented, but you could perhaps get the idea by looking at some of the
> management tests[2], specifically those that invoke methods on the broker
> such as the simple test_methods_sync.
>
> [1] https://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/src/tests/qpid-ctrl
>
> [2]
> https://svn.apache.org/repos/asf/qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/management.py
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
--
Tomáš Šoltys
tomas.soltys@gmail.com
http://www.range-software.com
(+420) 776-843-663
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: Set log level
Posted by Gordon Sim <gs...@redhat.com>.
On 11/29/2011 01:33 PM, Tomáš Šoltys wrote:
> Is there a way to change a broker log level from python script while
> broker is running?
Yes. One way is to use or emulate the qpid-ctrl script[1]. This was
designed to run from the command line for testing the changing of
log-level, e.g. qpid-ctrl -b localhost:$PORT setLogLevel
level='debug+:Broker', but can actually be used to ionvoke any QMFv2
'method' on the broker.
Alternatively you can use one of the QMF APIs. These aren't terribly
well documented, but you could perhaps get the idea by looking at some
of the management tests[2], specifically those that invoke methods on
the broker such as the simple test_methods_sync.
[1] https://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/src/tests/qpid-ctrl
[2]
https://svn.apache.org/repos/asf/qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/management.py
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org