Currently Consul logs (written to /var/log/upstart/consul.log at least for us) do not contain the timezone. This makes it difficult to accurately ingest the logs into a logging pipeline such as Logstash.
Oops, I meant timezone not timestamp.
@slackpad @joshuaspence I can tackle this. What should the format be for adding the timezone?
Currently a timestamp in the log looks like this:
2016/10/26 09:28:13 [INFO]
Should the timezone simply follow the time?
2016/10/26 09:28:13 PST [INFO] for example
In my opinion, better to follow a well known standard
https://en.wikipedia.org/wiki/ISO_8601
would be much easier to parse.
@rom-stratoscale I agree, standards all always nice. However, the Log package doesn't support that standard for some reason. There is an option to use UTC time instead but that's about it.
Closing this against https://github.com/hashicorp/consul/issues/1249, which will hopefully allow this to be customized.
To format the date, this seems to work without using any fancy packages:
https://play.golang.org/p/RC9JxV_LaA
I'm not quite sure where I can use that snippet within Consul though. Seem to be a simple change but I don't know about how to integrate with the consul codebase.
Most helpful comment
In my opinion, better to follow a well known standard
https://en.wikipedia.org/wiki/ISO_8601
would be much easier to parse.