Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Managing Business Logic Logs

Managing Business Logic Logs

Telerik Platform provides the option to log certain values in the console output. The output is available in a log entry created for each Cloud Code for Data CRUD operation or Cloud Function or Scheduled Job execution.

The following article explains how you can manage the logs with the Backend Services RESTful API.

Read Business Logic Logs

Execute the following snippet in order to retrieve all logs for your application.

$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/ServerCodeLog',
    type: "GET",
    headers: {
        "Authorization": "Masterkey your-master-key"
    },
    success: function (data) {
        alert(JSON.stringify(data));
    },
    error: function (error) {
        alert(JSON.stringify(error));
    }
});

If the request ends successfully the server will return an array of objects, each with the following structure:

  • CreatedAt
  • RequestDate
  • EventType
  • ResultType
  • Context
    • contentTypeName
    • contentTypeId
    • querySpecificAction
    • queryAction
    • executionType
    • requestId
  • ConsoleOutput
  • Error
  • Data
  • Id

Filter Business Logic Logs

You may want to retrieve the logs that match a specified filter. You can filter this system content type just as any other Telerik Platform content type. Refer to the aforementioned response structure for better overview of the fields you can filter on.

The following request will return all logs for the "type-name" content type.

var filter = { 'Context.contentTypeName' : 'type-name' };

$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/ServerCodeLog',
    type: "GET",
    headers: {
        "Authorization": "Masterkey your-master-key",
    "X-Everlive-Filter": JSON.stringify(filter)
    },
    success: function (data) {
        alert(JSON.stringify(data));
    },
    error: function (error) {
        alert(JSON.stringify(error));
    }
});

Delete Business Logic Logs

To delete all Business Logic logs, execute the following request:

$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/ServerCodeLog',
    type: "DELETE",
    headers: {
        "Authorization": "Masterkey your-master-key"
    },
    success: function (data) {
        alert(JSON.stringify(data));
    },
    error: function (error) {
        alert(JSON.stringify(error));
    }
});

You can also pass a filter to the request in order to delete a subset of the logs.

If the request ends successfully the server will return a "Result" key with a value the total amount of deleted items.

See Also

Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.