stream_service_logs#
- MonitorApi.stream_service_logs(client_type, *, backlog=100, max_messages=None)#
Stream log messages for a named HPS service.
Subscribes to messages filtered by the
client_typetag and yields each message as it arrives. UseClientTypeconstants for well-known services.- Return type:
- Parameters:
- client_type
str The
client_typetag value to filter on. Use aClientTypeconstant, e.g.ClientType.JMS,ClientType.HOUSEKEEPER, orClientType.SCALING.- backlog
int,optional Number of historical messages to request on connect. The default is
100.- max_messages
intorNone,optional Maximum total messages to yield before closing the connection. The default is
None, which streams indefinitely until interrupted or the server closes the connection.
- client_type
- Yields:
MonitorMessageParsed JSON message dicts from the server.
Examples
>>> for msg in api.stream_service_logs(ClientType.JMS): ... print(msg)