FintechOS Platform API Logging

The FintechOS Platform can log calls over the FintechOS Platform API (REST and WCF) and DataService CRUD operations.

Where Are the API Logs Stored?

The log entries are stored based on the platform's Observability settings (e.g. system console, local file storage, Seq structured log server, or Azure Application Insights service). API log entries can be identified by their event-issuer log context property which is set to InboundRequests.

What API Information is Logged?

The following Logging context properties can be tracked:

Log Context Property Description Example
base-user-id Authenticated user ID (for system users, not external users). 4afdc8a9-eb91-4359-81d6-c3a462fae866
CorrelationId GUID which correlates the initial call from one of the internal FintechOS Platform components or from an external client application with the subsequent calls triggered between FintechOS Platform components. 420e4312-aa09-4d3e-8cfb-32aca1b54694
RequestId Request ID f9ab337a-57d0-4cb2-b0a6-1c51ea72b45c
source-type Type of API call
  • OpenApi
  • ApiService
  • DataService
  • Account
DataService
method-name API method name CallAction
client-ip Client IP 192.168.30.18
request API request parameter as JSON
Copy
{
  "ActionId": "b2063100-ee43-4d3c-b891-5ace19978c64",
  "ActionName": "TestScript",
  "EntityName": "workflow",
  "IsList": true,
  "EntityIds": [
    "f69b8eee-4684-4fa6-93f5-536f9145c8af",
    "a55d3165-e6c0-4545-8734-58124dc263da",
    "e5eb71d1-3dc4-4bbe-96c4-92887df3611c"
  ],
  "Data": null,
  "Values": []
}
exception Response error  
success
  • True
  • False
True
call-duration Call duration in milliseconds 110.5123
response-content Content of the response
Copy
{
  "UIResult": null,
  "Message": null,
  "IsSuccess": true,
  "ClientScript": null,
  "Serialized": "{\"UIResult\":null, \"Message\":null, \"IsSuccess\":true, \"ClientScript\":null, \"Serialized\":null, \"ErrorCode\":0}",
  "ErrorCode": 0
}
event-issuer Always set to InboundRequests and is used to filter the API entry logs from other logging events. InboundRequests
response-message Response message, sub-property for response-content.  
request-headers List of headers (with security related headers like AccessToken removed).  

Severity

The severity level of the log entries is set by default to Information. In case of an error (e.g.: the exception log context property is not null), it will be set to Error.

How to Configure API Logging

To configure API logging, in the Configuration Manager, configure the kv/<environment name>/<portal instance>/app-settings/ApiLoggingConfig key as shown below:

Copy
{
    "sources": [
        {
            "name": "DataService",
            "methods": [
                {
                    "name": "CallAction"
                },
                {
                    "name": "GetById",
                    "input": {
                        "properties": [
                            {
                                "name": "A",
                                "excluded": true
                            }
                        ]
                    }
                }
            ]
        }
    ]
}
 

Source names:

  • OpenApi (REST endpoint)
  • ApiService (WCF endpoint)
  • DataService (MVC endpoint)

The configuration allows filtering the API logging elements at different levels of granularity: source, method (action), input (request), output (result), input property, output property.

The user can enable logging for all methods of a source by specifying "*" as the method name. Any explicitly defined method will override the full logging from "*".

NOTE  
When a property is excluded, it will not be serialized in the log.

Enable API Logging

Once you have set up API logging, in the Configuration Manager, set the kv/<environment name>/<portal instance>/feature-log-api-inbound key to 1 to enable it (setting the key to 0 disables API logging).

IMPORTANT!  
Setting the feature-log-api-inbound key value to true instead of 1 will not work.