Ziti router log enable

Hi team,

My requirement is to write the logs from this command zt-router-logs to a log file in the EdgeRouter and let me know the steps to configure this. Later I will configure the log rotation.

Hi @itkt, welcome to the forum and to OpenZiti.

zt-router-logs is an alias that comes from the appliances provided by NetFoundry. If you type alias zt-router-logs you’ll see the command’s definition:

alias zt-router-logs
alias zt-router-logs='journalctl -u ziti-router -efo cat | /opt/netfoundry/ziti/ziti ops log-format -a'

Logs are stored using journald. You can fetch them to a file by running a similar command as zt-router-logs or by running any other journalctl command like the one shown: journalctl -u ziti-router --since "1 hours ago" for example.

Hope that helps

Hi @lumberjack,

Thanks for your reply and it’s working.
But i need the logs for past 2 months. How can i get that?

At some point, I would expect journald to roll over. I don’t know when that happens to be honest… You can remove the “since” portion of the command I sent you to get ‘all the logs’ that are there, (which mihgt take a bit to stream out to a file) but if it doesn’t go back two months, there will be no way to do that.