Custom Adapter

Log Owl offers a public interface that allows you to build your own custom adapter that fits your individual needs. All you need to do is catching the error in your system and sending it as POST request to the endpoint /logging/error.

caution

All timestamps need to be UTC timestamps in seconds. The endpoint will always respond with code 200 as long as the body is valid.

Sample Request

{
"ticket": "2ATNP1AD70",
"message": "test is not a function",
"path": "/User/example/server/src/server/server.js",
"line": "15",
"stacktrace": "the error stack trace",
"badges": {
"cluster": "test"
},
"type": "exception",
"metrics": {
"platform": "linux"
},
"logs": [
{
"type": "info",
"log": "process started",
"timestamp": 1585689440
}
],
"snippet": {
"10": " cluster: 'EU',",
"11": " serviceID: '20010-A'",
"12": " }",
"13": "});",
"14": "",
"15": "test();",
"16": "",
"17": "// Routes",
"18": "const routes = require('../routes');",
"19": "",
"20": "// Configs"
},
"userInteractions": [
{
"element": "BUTTON",
"innerText": "Submit",
"elementId": "submit-button",
"location": "/contact"
}
],
"timestamp": 1585689898,
"adapter": {
"name": "my-custom-python-adapter",
"type": "custom",
"version": "v0.1.0"
}
}

Sample Response

{
"ok": true,
"code": 200
}

Limits

  • message: can have a maximum length of 1000 characters
  • stacktrace: can have a length of up to 15000 characters.
  • logs: the array can contain up to 50 log objects. The property log can have up to 1000 characters and the type up to 100.
  • userInteractions: the array can contain up to 50 user interaction objects. The properties element, innerText and elementId can contain up to 200 characters and the property location can contain a maximum of 400 characters.
  • badges: the object can have up to 100 properties. Property names can have 100 characters and property values 200 characters.
  • snippet: the object can have a maximum of 50 properties. The key can have up to 10 characters while the value can contain up to 800 characters.
  • metrics: the property platform can contain up to 500 characters
  • adapter: each of the adapter's properties can have a maximum length of 100 characters.

If these limits are exceeded, the server will respond with an error and not process the event.

{
"ok": false,
"code": 400,
"message": "the provided data is too large"
}