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

ASCII codes logs #170

Open
raindog308 opened this issue Aug 12, 2020 · 3 comments
Open

ASCII codes logs #170

raindog308 opened this issue Aug 12, 2020 · 3 comments

Comments

@raindog308
Copy link

My logs have strange codes that look like ASCII codes:

Aug 12 14:34:18 mail inbucket[18299]: #033[90m2:34PM#033[0m #033[32mINF#033[0m Inbucket starting #033[36mbuildDate=#033[0mundefined #033[36mphase=#033[0mstartup #033[36mversion=#033[0mundefined
Aug 12 14:34:18 mail inbucket[18299]: #033[90m2:34PM#033[0m #033[32mINF#033[0m Retention configured for 1317600h0m0s #033[36mmodule=#033[0mstorage #033[36mphase=#033[0mstartup
Aug 12 14:34:18 mail inbucket[18299]: #033[90m2:34PM#033[0m #033[32mINF#033[0m Web UI content mapped #033[36mmodule=#033[0mweb #033[36mpath=#033[0mui/dist #033[36mphase=#033[0mstartup

Every single line in the logs looks like this. Is this normal? Can it be changed/suppressed? Thanks.

@jhillyerd
Copy link
Collaborator

You can start it with -logjson as an argument to switch the format to a structured JSON log.

I should look into moving that to an environment variable like the rest of the config.

@raindog308
Copy link
Author

I think I meant ANSI color codes, not ASCII.

I'm not sure hard-to-read-json is better than hard-to-read-with-embedded-ANSI-codes.

I've never seen software that emits ANSI codes (if that's what these are) in the logs - is there some kind of environment variable or setting that simply eliminates them?

Looks like the rs/zerolog package puts them in so they look pretty and colored...but that doesn't seem to translate well into /var/log/daemon.log, even if I sent my session's TERM to "ansi".

@jhillyerd
Copy link
Collaborator

I didn't see a way to change zerolog w/ environment variables, but I think it does support custom formats. I don't see why Inbucket couldn't support a "syslog" style log format along with the other two.

I think the reason it is currently configured via command line is Inbucket used to parse a config file, and that could fail (and be logged), so the log format couldn't be specified in that file. Probably not an issue with env vars.

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

No branches or pull requests

2 participants