Closed s004pmg closed 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?
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.
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.
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.