Overview
Disclaimer
For reasons of data protection, SAP strongly recommends you not to log any sensitive data when you use the Engagement Center UI Logging service. SAP does not accept any liability for the use of the service by its customers.
Features
The Engagement Center UI Logging service is a business service that enables you to post log entries and record them in the YaaS logging system.
Using this service, you can post messages or metrics, which conform to message format or metric format specifications.
API Reference
/log
UI Logging
/log
Create a logging entry in the Engagement Center UI Logging service. It will be in either message format or metric format.
Both message format and metric format will have logging level and tags for event categories.
- For message format, you can include a string message in the request body.
- For metric format, you need to include the metric name, metric type, and metric value in the request body.
Required scope: hybris.cecenteruilog
Scopes
The table shows the scopes that the Engagement Center UI Logging service supports.
SCOPE | DESCRIPTION |
---|---|
hybris.cecenteruilog | Create log entries |
For more information about scopes, authorization, and authentication procedures for YaaS services, see Scopes and Authorization.
Message Format
To enable the monitoring tool to aggregate the logs in a usable way, every application log must follow a specific log pattern. The service uses the message format to record the application logs in the conventional log format. The message format contains these fields:
- Level: There are five types of values for this field, which shows the logging level of the event:
INFO
,WARN
,ERROR
,DEBUG
, andTRACE
. - Message: This field shows the content of the logging message.
- Tags: In the Tags field, which shows the logging tag for additional categories of the logging event, use the tag
MESSAGE
for the message format.
Example of the message format:
{
"level":"INFO",
"message": "logging item",
"tags": ["UILogging","MESSAGE","I058959"]
}
Metric Format
Use the metric format to record the data related to particular functions (for example, user sign-in, sign-out, and other incoming requests) or group information that the system monitors for further statistical analysis.
The metric format contains these fields:
- Level: There are five types of values for this field, which shows the logging level of the event:
INFO
,WARN
,ERROR
,DEBUG
, andTRACE
. - Metric: This field shows the name of the logging metric.
- Type: This field shows the type of the logging metric. There are two types of values for this field:
NUMBER
andSTRING
. - Value: This field shows the content of the logging metric. If the type is
NUMBER
, fill in the field with a numeric value. If the type isSTRING
, fill in the field with a string value. - Tags: This field shows the logging tag for additional categories of the logging event. Use the tag
METRIC
for the metric format.
Example of the metric format:
{
"level":"INFO",
"metric": "request.performance",
"type":"NUMBER",
"value":"859",
"tags": ["UILogging","METRIC","I058959"]
}
The Use Case for the Engagement Center UI Logging Service
The YaaS platform provides an infrastructure that monitors incoming requests across all applications in a consistent way. It analyzes the logs of all the applications for usage analytics, user interface (UI) problem detection, constant security monitoring, and other aspects. To enable the infrastructure to collect this information, all applications must log to the console.
These are the major use cases for the Engagement Center UI Logging service:
- Exceptional incidents, which, when logged at the time of the incident, help a developer or administrator find out the root cause of the issue and perform a hotfix.
- Monitoring and analysis of user operations, such as the most frequent user actions, the most active users, and similar information.
- Method run times, which are the foundation of system status analysis.
- Critical performance measurement, which monitors the system's front end.
The Engagement Center UI Logging Service enables your application to be compliant with the stated requirements by sending logs in a predefined format to the RESTful API. The logs are printed in a predefined JSON format and redirected to the log management service, logstash. You can view the logs later in tools like Kibana.
Create a Log Entry
To create a new log entry, you need:
Request
- Method: POST
- Request URL:
https://api.beta.yaas.io/hybris/cecenteruilog/v1/log
- Headers
- Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.cecenteruilog.
- URI Parameters
- {tenant}: The name of the current tenant
- Body: Example of the request body for the message format:
{ "level":"INFO", "message": "logging item", "tags": ["UILogging","MESSAGE","I058959"] }
Response
The successful response returns a 201
status code.
Error Types
For information about error codes, see the API Reference.
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.