Analytics log

Content Manager OnDemand REST Services can be configured to output log files that can be ingested by analytics platforms (such as Splunk, Elastic, and so on) that support NDJSON-formatted log files. These tools can monitor directories for new files and ingest them according to preconfigured patterns.

To disable or enable the Analytics log output, edit the log4j2.xml file as previously described, set the level to OFF or INFO. No other level is relevant for this logger. As previously mentioned, this then generates a NDJSON-formatted log file. The default filename is analytics.log.

Analytics log output fields

By default, the analytics output file contains the following fields:

Date - The date and timestamp of the request in the format of yyyy-MM-dd HH:mm:ss.SSS

Correlation-Id - The unique ID of the request/response

Method - The HTTP/HTTPS request type

Path - The path of the incoming request

Scheme - The algorithm that is used to calculate the signature

Access_Key - The key portion of the access key

Connection_Pool - The connection pool name

Execution_Time - The time it takes to satisfy a request in milliseconds. This field is blank for the initial request

Status - The HTTP/HTTPS status of the request. This field is blank for the initial request

Level - Current log level setting

Message - Will be “Request” or “Response”

You can remove any of these fields by editing the “ANALYTICS_PATTERN” properties in the log4j2.xml file.

The following example shows sample output for a given response.

"Date": "2021-04-24 07:02:09.700",
"Correlation-Id": "7ce1af16-8a68-4b3c-9357-fe4b537e34a5",
"Method": "GET",
"Path": "v1/folders",
"Scheme": "CMODSharedKey",
"Access_Key": "Xc",
"Connection_Pool": "od105ctrhelsec",
"Execution_time": "97",
"Status": "200",
"level": "INFO ",
"message": "Response"

As you can see, the log files include a variety of fields that can be used to build visualizations. These visualizations can answer questions about your Content Manager OnDemand REST Services application.

Some example questions:

  • How many requests are we getting over time?
  • How long are those requests taking and which connection pool is servicing the request?
  • Which Content Manager OnDemand folders are being searched most frequently?
  • How many document retrievals are being performed per hour?