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

logging in JSON format #59

Open
alext234 opened this issue Jul 17, 2020 · 2 comments
Open

logging in JSON format #59

alext234 opened this issue Jul 17, 2020 · 2 comments

Comments

@alext234
Copy link

alext234 commented Jul 17, 2020

I've started looking at start_model_server() and this documentation on logging at
https://github.com/awslabs/multi-model-server/blob/master/docs/logging.md

but still not sure how we go about changing it to output JSON format, with extra custom fields.

Is there any guide on this part?

@chuyang-deng
Copy link
Contributor

Hi @alext234 , the MMS documentation does not seem to mention that model server logs can be converted to JSON format. what is the log contents that you wish to see but we did not output?

Also, if you want to use a different log level, you could use SAGEMAKER_CONTAINER_LOG env var to adjust that.

@alext234
Copy link
Author

Hi @ChuyangDeng
JSON format would be convenient for centralised logging system to easily index and search. We can also add custom kv fields to the logs. One use-case is we add a json formatter to the standard Python logging module any log from our code are in JSOn format, for example

            logger.info("inference completed", extra={"result": result})

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