Skip to content

Timestamp is missing in log file #1714

@liranamrani

Description

@liranamrani

Consul Template version

0.30.0

Configuration

log_level = "info"
pid_file = "D:/XXX/Logs/consul-template.pid"
# This block defines the configuration for logging to file
log_file {
  path = "D:/XXX/Logs/consul-template.log"
  log_rotate_bytes = 1024000
  log_rotate_duration = "24h"
  log_rotate_max_files = 6
}

Command

consul-template -config "C:\XXX\consul-template\config\config.hcl"

Debug output

LOG File -

[INFO] consul-template v0.30.0 (28bba12)
[INFO] (runner) creating new runner (dry: false, once: false)
[WARN] (clients) disabling consul SSL verification
[INFO] (runner) creating watcher
[INFO] (runner) starting
[INFO] creating pid file at "D:/XXX/Logs/consul-template.pid"

CMD log -

2023/03/02 06:38:36 [DEBUG] (logging) enabling log_file logging to D:\XXX\Logs\consul-template.log with rotation every 24h0m0s
2023-03-02T06:38:36.523Z [INFO] consul-template v0.30.0 (28bba12)
2023-03-02T06:38:36.524Z [INFO] (runner) creating new runner (dry: false, once: false)
2023-03-02T06:38:36.524Z [WARN] (clients) disabling consul SSL verification
2023-03-02T06:38:36.525Z [INFO] (runner) creating watcher
2023-03-02T06:38:36.525Z [INFO] (runner) starting
2023-03-02T06:38:36.526Z [INFO] creating pid file at "D:/XXX/Logs/consul-template.pid"

Expected behavior

THE Output that I mentioned is from the log file "D:/XXX/Logs/consul-template.log"
As you can see, there is no timestamp in the log file, I would expect to see the timestamp - as I see it when I run it on the cmd.

Actual behavior

What actually happened?
the log file is missing timestamp, what should I do with that?
As you can see I'm on Windows Server.

I tried to run it this way
consul-template -config "C:\XXX\consul-template\config\config.hcl" -log-level=DEBUG 1>> consul-template.log 2>&1
BUT I lost in that way the rotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions