HDFGroup / hsds

Cloud-native, service based access to HDF data
https://www.hdfgroup.org/solutions/hdf-kita/
Apache License 2.0
129 stars 53 forks source link

Timestamp all log messages #59

Closed s004pmg closed 4 years ago

s004pmg commented 4 years ago

In trying to debug a cluster wide failure, I'm hampered by only some of the log messages having timestamps. I'm unable to associate what's happening across processes to do a proper postmortem.

This includes logs at all log levels. A common pattern in python is to use https://docs.python.org/3/library/logging.html, which allows sites to do configuration of what information is in the log message prefixes. Common enterprise patterns use log aggregation and indexing software, with site configurable prefixes for local logging and traceability requirements.

jreadey commented 4 years ago

In docker you can just use logs with the -t option. e.g.:

$ docker logs -t hsds_sn_1
2020-04-25T15:27:59.461546000Z DEBUG> head_url: http://hsds_head:5100
2020-04-25T15:27:59.462017000Z DEBUG> health check req http://hsds_head:5100/nodestate
2020-04-25T15:27:59.462411000Z INFO> http_get('http://hsds_head:5100/nodestate')
2020-04-25T15:27:59.470385000Z INFO> http_get status: 200

Doesn't that suffice?

s004pmg commented 4 years ago

Yeah, let's close this. In my case, we're sending the logs to another logging aggregator so this doesn't help me, but as written this ticket is stated incorrectly.

jreadey commented 4 years ago

I'd be happy to accept a PR to make the logging configurable. Just don't want to duplicate the timestamps for people who are taking advantage of docker/kubernetes logging.