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

Liberty log is not in JSON format #520

Open
fmhwong opened this issue Sep 30, 2020 · 8 comments
Open

Liberty log is not in JSON format #520

fmhwong opened this issue Sep 30, 2020 · 8 comments

Comments

@fmhwong
Copy link
Member

fmhwong commented Sep 30, 2020

It is recommended to use JSON format for Liberty log when running in containers so that the log entries can be aggregated and analyzed by EFK.

@gkwan-ibm
Copy link
Member

@fmhwong, I think you are not only recommend to the openshift guide but also to all the cloud guides, right? How about the guides are using docker or kubernetes?

cc @yeekangc

@fmhwong
Copy link
Member Author

fmhwong commented Oct 1, 2020

I would recommend to use JSON logging in all cloud guides as all cloud service should have some sort of log aggregation feature such as LogDNA, EFK, etc. For guides that run on local docker, you can leave it as plain text logging as it may be easier to read.

@gkwan-ibm
Copy link
Member

Thank you @fmhwong
Would you post what should be configured? I assume just update the server.xml, right?

@gkwan-ibm gkwan-ibm transferred this issue from OpenLiberty/archived-guide-cloud-openshift Oct 7, 2020
@gkwan-ibm
Copy link
Member

gkwan-ibm commented Oct 7, 2020

Need to consider the following guides

@gkwan-ibm
Copy link
Member

Based on https://openliberty.io/docs/latest/log-trace-configuration.html#_json_logging, add following to the server.xml
<logging messageFormat="json" messageSource="message,trace,accessLog,ffdc,audit" />

@fmhwong
Copy link
Member Author

fmhwong commented Oct 7, 2020

I think the best practice is to set the environment variables for containers so that you don't need to rebuild the image if you want to change it in the future.

@gkwan-ibm
Copy link
Member

@fmhwong It means better to do it through yaml

@yeekangc
Copy link
Member

We can further break this down into one issue for each cloud guide that needs to be updated.

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

No branches or pull requests

3 participants