[
https://issues.apache.org/jira/browse/IGNITE-15103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17380159#comment-17380159
]
Ivan Daschinsky edited comment on IGNITE-15103 at 7/13/21, 8:34 PM:
--------------------------------------------------------------------
Example of logging output
{code}
2021-07-13 22:11:08,631 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10801) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,645 pyignite.connection DEBUG Connected to
node(address=127.0.0.1, port=10801,
node_uuid=60ff4be9-d14c-4973-bce8-1c634afc587d) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,646 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10802) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,677 pyignite.connection DEBUG Connected to
node(address=127.0.0.1, port=10802,
node_uuid=5a6d4e3f-e202-404a-9670-cb1bbd5029be) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,678 pyignite.queries DEBUG Start query(query_id=6436,
op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:08,685 pyignite.queries DEBUG Finished
query(query_id=6436, op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 7.000 ms
2021-07-13 22:11:08,686 pyignite.queries DEBUG Start query(query_id=6437,
op_type=OP_CLUSTER_CHANGE_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:08,689 pyignite.queries DEBUG Finished
query(query_id=6437, op_type=OP_CLUSTER_CHANGE_STATE, host=127.0.0.1,
port=10801, node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 3.000
ms
2021-07-13 22:11:08,690 pyignite.queries DEBUG Start query(query_id=6438,
op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
2021-07-13 22:11:08,697 pyignite.queries DEBUG Finished
query(query_id=6438, op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be) successfully in 7.000 ms
2021-07-13 22:11:09,887 pyignite.queries DEBUG Start query(query_id=6486,
op_type=OP_CACHE_PARTITIONS, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
2021-07-13 22:11:09,948 pyignite.queries DEBUG Finished
query(query_id=6486, op_type=OP_CACHE_PARTITIONS, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be) successfully in 60.000 ms
2021-07-13 22:11:09,948 pyignite.queries DEBUG Start query(query_id=6487,
op_type=OP_CACHE_PUT, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,951 pyignite.queries DEBUG Finished
query(query_id=6487, op_type=OP_CACHE_PUT, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 3.000 ms
2021-07-13 22:11:09,952 pyignite.queries DEBUG Start query(query_id=6488,
op_type=OP_CACHE_GET, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,954 pyignite.queries DEBUG Finished
query(query_id=6488, op_type=OP_CACHE_GET, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 1.000 ms
2021-07-13 22:11:09,954 pyignite.connection DEBUG Connection closed to
node(address=127.0.0.1, port=10801,
node_uuid=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,954 pyignite.connection DEBUG Connection closed to
node(address=127.0.0.1, port=10802,
node_uuid=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
{code}
{code}
2021-07-13 22:12:34,588 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10801) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:12:34,628 pyignite.connection ERROR Authentication failed
while connecting to node(address=127.0.0.1, port=10801): The user name or
password is incorrect [userName=null]
{code}
{code}
2021-07-13 22:13:27,969 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10801) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:13:27,972 pyignite.connection ERROR Failed to perform
handshake, connection to node(address=127.0.0.1, port=10801) with protocol
context None failed: Connection broken.
{code}
was (Author: ivandasch):
Example of logging output
{code}
2021-07-13 22:11:08,631 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10801) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,645 pyignite.connection DEBUG Connected to
node(address=127.0.0.1, port=10801,
node_uuid=60ff4be9-d14c-4973-bce8-1c634afc587d) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,646 pyignite.connection DEBUG Connecting to
node(address=127.0.0.1, port=10802) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,677 pyignite.connection DEBUG Connected to
node(address=127.0.0.1, port=10802,
node_uuid=5a6d4e3f-e202-404a-9670-cb1bbd5029be) with protocol context
ProtocolContext(version=(1, 7, 0), features=BitmaskFeature.CLUSTER_API)
2021-07-13 22:11:08,678 pyignite.queries DEBUG Start query(query_id=6436,
op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:08,685 pyignite.queries DEBUG Finished
query(query_id=6436, op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 7.000 ms
2021-07-13 22:11:08,686 pyignite.queries DEBUG Start query(query_id=6437,
op_type=OP_CLUSTER_CHANGE_STATE, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:08,689 pyignite.queries DEBUG Finished
query(query_id=6437, op_type=OP_CLUSTER_CHANGE_STATE, host=127.0.0.1,
port=10801, node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 3.000
ms
2021-07-13 22:11:08,690 pyignite.queries DEBUG Start query(query_id=6438,
op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
2021-07-13 22:11:08,697 pyignite.queries DEBUG Finished
query(query_id=6438, op_type=OP_CLUSTER_GET_STATE, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be) successfully in 7.000 ms
2021-07-13 22:11:09,887 pyignite.queries DEBUG Start query(query_id=6486,
op_type=OP_CACHE_PARTITIONS, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
2021-07-13 22:11:09,948 pyignite.queries DEBUG Finished
query(query_id=6486, op_type=OP_CACHE_PARTITIONS, host=127.0.0.1, port=10802,
node_id=5a6d4e3f-e202-404a-9670-cb1bbd5029be) successfully in 60.000 ms
2021-07-13 22:11:09,948 pyignite.queries DEBUG Start query(query_id=6487,
op_type=OP_CACHE_PUT, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,951 pyignite.queries DEBUG Finished
query(query_id=6487, op_type=OP_CACHE_PUT, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 3.000 ms
2021-07-13 22:11:09,952 pyignite.queries DEBUG Start query(query_id=6488,
op_type=OP_CACHE_GET, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,954 pyignite.queries DEBUG Finished
query(query_id=6488, op_type=OP_CACHE_GET, host=127.0.0.1, port=10801,
node_id=60ff4be9-d14c-4973-bce8-1c634afc587d) successfully in 1.000 ms
2021-07-13 22:11:09,954 pyignite.connection DEBUG Connection closed to
node(address=127.0.0.1, port=10801,
node_uuid=60ff4be9-d14c-4973-bce8-1c634afc587d)
2021-07-13 22:11:09,954 pyignite.connection DEBUG Connection closed to
node(address=127.0.0.1, port=10802,
node_uuid=5a6d4e3f-e202-404a-9670-cb1bbd5029be)
{code}
> Add logging to pyignite client
> ------------------------------
>
> Key: IGNITE-15103
> URL: https://issues.apache.org/jira/browse/IGNITE-15103
> Project: Ignite
> Issue Type: Improvement
> Components: python, thin client
> Reporter: Ivan Daschinsky
> Assignee: Ivan Daschinsky
> Priority: Major
> Labels: python, thin
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently, there is no logging at all, should be added using {{logging}}
> module
> Also, optional handler to {{stderr}} should be added if env variable is set,
> [i.e.|https://github.com/aio-libs/aioredis-py/blob/bb0dcebed350a5f764dc84c5b6bcb44a3bf98c6b/aioredis/log.py]
> {code:python}
> logger = logging.getLogger("pyignite")
> if os.environ.get("PYIGNITE_DEBUG"):
> logger.setLevel(logging.DEBUG)
> handler = logging.StreamHandler(stream=sys.stderr)
> handler.setFormatter(
> logging.Formatter("%(asctime)s %(name)s %(levelname)s %(message)s")
> )
> logger.addHandler(handler)
> os.environ["PYIGNITE_DEBUG"] = ""
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)