Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log level to either command line or config files for router and controller #1044

Open
plorenz opened this issue Mar 17, 2023 · 5 comments

Comments

@plorenz
Copy link
Member

plorenz commented Mar 17, 2023

Right now you can only set log level to info (the default) or debug (using the -v flag). Should be able to select other log levels.

@pixitha
Copy link

pixitha commented Sep 21, 2023

Could we also look at adjusting this as well, the quotes around the code in ExecStart is invalid, so adding the logging stanza at the end, we have to manually edit this every time we build a service.

Default format:

[Unit]
Description=Ziti-Router for ad-use1-1.yaml
After=network.target

[Service]
User=root
WorkingDirectory=/opt/ziti
ExecStart="/opt/ziti/ziti-bin/ziti" router run "/opt/ziti/ad-use1-1.yaml.yaml"
Restart=always
RestartSec=2
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

How we have to edit it

ExecStart=/opt/ziti/ziti-bin/ziti router run /opt/ziti/ad-use1-1.yaml --log-formatter pfxlog

@dovholuknf
Copy link
Member

Interesting. I assume you've used the quickstart to generate the systemd file... What OS are you running and how does the error manifest that makes you need to update it like that?

@pixitha
Copy link

pixitha commented Sep 21, 2023

Ubuntu/Rhel8/Amazon Linux I think all use that same systemd file. We were having issues watching the logs in real time and found the pfxlog format easier to use.

https://openziti.discourse.group/t/log-tuning-for-ziti-router/1162 was the source for this issue.

We have really chatty services across the overlay and trying to find errors in real time when your working on a node was difficult.

@dovholuknf
Copy link
Member

and found the pfxlog format easier to use

that's for sure! :) I do all my testing with Ubuntu and the systemd file that the quickstart generates has never been an issue. I wonder if it's a RHEL problem, i rarely try RHEL. I can try spinning up an amazon linux and see what happens. I'll also reach out to my systemd expert friend for RHEL help...

Just a 'for instance', I updated my current router to look like yours and you can see it somehow runs fine...
image

@plorenz
Copy link
Member Author

plorenz commented Sep 21, 2023

@pixitha in case it's useful, you can also post-process the json to pfxlog format, either using the pfxlog binary, built from that repo, or by using the version built into ziti: ziti ops log-format. I do that regularly when debugging production systems, which require json for ingest, as it's easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants