Parameter -log-rotate-duration value unit?

262 views
Skip to first unread message

frannelk

unread,
Apr 15, 2019, 11:44:07 AM4/15/19
to Consul
Hi,

I'm trying to set a log rotation time for my consul server, but every time I ran the command below I get this error: "* log_rotate_duration: invalid duration: "24": time: unknown unit day in duration 24", I though it supposed to be 24 hours, but after several tries I have no clue which value it takes.

.\consul.exe agent -data-dir=D:\some_path\consul -config-dir=D:\some_path\consul -log-file=D:\some_path\consul\logs|log_consul.log -log-rotate-bytes=1048576 -log-rotate-duration=XXX -server=true -bootstrap=true -datacenter="BLABLA" -ui=true -client='XXXXX -bind='XXXXX'

What is the actual value unit for that parameters?, I want to use 5 or 50 minutes, because I have almost 200's health checks and the log write a lot of info. BTW there is a bug and consul does not respect the trace level, even if you put INFO, you get DEBUG, check this out: https://github.com/hashicorp/consul/pull/5510

I believe the documentation needs some clarity, thank you.

Best wishes.

Pierre Souchay

unread,
Apr 16, 2019, 4:03:33 AM4/16/19
to Consul
In Consul, most duration are expressed with duration as specified here: https://golang.org/pkg/time/#ParseDuration - Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

So, basically, if you want hours, set it with "24h"

Frannelk Rojas

unread,
Apr 16, 2019, 8:11:51 AM4/16/19
to consu...@googlegroups.com
Pierre,

Kind of you for this information 😀😀, Hopefully somebody will copy&paste it on consul documentation.

Regards 🖐🖐🖐

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
Community chat: https://gitter.im/hashicorp-consul/Lobby
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/7415ee65-9887-4840-8c02-b3fead0fd078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RamG

unread,
Sep 18, 2019, 12:27:50 PM9/18/19
to Consul
frannelk,

I am also using 1.2.3 version and i do see that log_level is not honoring, but i also see that log rotation is not working as well, it is rotation to a new file but also updating consul.log file and in the rotated log files the log level is DEBUG. Do you see the same behavior?

Thanks,
Ram
Reply all
Reply to author
Forward
0 new messages