Analyzing Application Run Logs in Log4j Format on the LTS Console
Introduction
Log4j is Apache's open-source project used for logging. It enables you to output logs to log files, so that development or O&M personnel can calculate the number and proportion of logs at different levels, or gather statistics on services from run logs.
For example, you can know the transaction volume of an offering on a day from logs such as the following:
2020-12-28_21:10:48.081 [http-nio-8083-exec-6] INFO discounted shoes - num is :9
Analyzing Application Run Logs in Log4j Format on the LTS Console
- Log in to the LTS console and choose Log Ingestion in the navigation pane.
- Click Elastic Cloud Server (ECS) to configure log ingestion.
- Select a log stream.
- Select a log group from the drop-down list of Log Group. If there are no desired log groups, click Create Log Group to create one.
- Select a log stream from the drop-down list of Log Stream. If there are no desired log streams, click Create Log Stream to create one.
- Click Next: (Optional) Select Host Group.
- Select host groups.
- Select one or more host groups from which you want to collect logs. If there are no desired host groups, click Create above the host group list to create one. For details, see Managing Host Groups.
- Click Next: Collection Configuration.
- Configure the collection.
- Configure the collection parameters. For details, see Configurations.
- Click Next: Index Settings. Retain the default settings.
- Click Submit to complete the ingestion configuration.
- On the log stream details page, click
. On the Cloud Structuring Parsing page, select Regular Expressions, select a log event, and extract four fields: Time1, ThreadName, Level, and Message.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.