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

All log events go to stderr. #351

Closed
snorrid opened this issue Aug 19, 2021 · 3 comments
Closed

All log events go to stderr. #351

snorrid opened this issue Aug 19, 2021 · 3 comments

Comments

@snorrid
Copy link

snorrid commented Aug 19, 2021

Description

When running Typesense 0.21 all console output is directed to stderr. This makes it difficult in a Kubernetes environment to distinguish errors from logging event.

It seems the GLOG library used for logging doesn't support sending to anything but stderr.

Steps to reproduce

docker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:0.21.0 --data-dir /data --api-key=Hu52dwsas2AdxdE 2> stderr.log This will output stderr events to a file. As you can see everything is stderr.

Expected Behavior

Log Info/Warning to stdout and errors to stderr.

Actual Behavior

Everything is logged to stderr.

Metadata

Typsense Version: 0.21

@kishorenc
Copy link
Member

@snorrid Thanks for reporting this issue. I looked into this in detail. Unfortunately, GLOG supports log level separation only for files. For console logging, it gives only two options:

a) Send only ERROR logs to stderr (default)
b) Send both INFO and ERROR logs to stderr (which is what we have configured Typesense with)

I've created an issue on Glog.

For now, you might have to rely on a log aggregator for alerting that can differentiate between INFO and ERROR logs based on a regexp parsing configuration.

@kishorenc
Copy link
Member

Note to self: FLAGS_logtostderr is now available on Glog (PR) so this issue is now fixable. Will require rebuilding Typesense and its dependencies with a version of Glog that contains that patch.

@kishorenc
Copy link
Member

Fixed by cad2d80 and will be available in v0.25 when released.

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

Successfully merging a pull request may close this issue.

2 participants