CorvidReference

LogEntry

A single record of a Wix site event in JSON format.

Note the following terminology:

  • Log entry: Single record of a Wix site event.
  • Log: Collection of log entries associated with the same site and namespace.

    The following is an example of a LogEntry:

    Log Entry for Console Log in HTTP Function

     {
       "timestamp": "2019-03-31T06:02:12.008Z",
       "receiveTimestamp": "2019-03-31T06:02:12.925Z",
       "severity": "INFO",
       "insertId": "6axgiF6X45ftx7A1bjJBCh",
       "labels": {
         "siteUrl": "https://my-site.com",
         "namespace": "Corvid",
         "tenantId": "fbd4e3c6-8e55-4098-b0ff-5e478b6c957e",
         "viewMode": "Site",
         "revision": "12"
       },
       "operation": {
         "id": "1554017373.14484058793726342",
         "producer": "httpFunction:myFunction",
       },
       "sourceLocation": {
         "file": "http-functions.js",
         "line": 14
       },
       "jsonPayload": {
         "message": "myFunction called."
       }
     }

Note

Currently, you cannot add content to log entries. All log entry data is generated by Corvid.

Table of Contents

PROPERTIES

?
Store values associated with an object.
insertIdUnique identifier for the log entry.
jsonPayloadPayload of the log entry in JSON format.
labelsAdditional information about the log entry.
operationAdditional information about a potentially long-running operation associated with the log entry.
receiveTimestampTime the log entry was received by site monitoring.
severitySeverity of the log entry.
sourceLocationSource code location information associated with the log entry.
timestampTime the site event occurred.

OBJECTS

?
Objects used when setting, getting, or calling the properties and methods listed above.
LogEntryJsonPayloadPayload of the log entry in JSON format.
LogEntryLabelsAdditional information about the log entry.
LogEntryOperationAdditional information about a potentially long-running operation associated with the log entry.
LogEntrySourceLocationSource code location information associated with the log entry. Currently only applicable for backend log entries with the Corvid namespace.

insertId

Unique identifier for the log entry.

Description

Each log entry is assigned a unique ID. A log entry with the same insertId as another log entry indicates a duplicate.

Syntax

get insertId(): string
TYPE
?
The kind of data the property stores.
string

Examples

Log entry insertId

{
  // ...

  "insertId": "6axgiF6X45ftx7A1bjJBCh",

  // ...
}

jsonPayload

Payload of the log entry in JSON format.

Syntax

get jsonPayload(): LogEntryJsonPayload

Examples

Log entry payload information

{
   // ...

   "jsonPayload": {
     "message": "#contactUs button was clicked." // Console log
   },

   // ...
 }

labels

Additional information about the log entry.

Syntax

get labels(): LogEntryLabels

Examples

Log entry labels

{
   // ...

   "labels": {
     "siteUrl": "https://my-site.com",
     "namespace": "Corvid",
     "tenantId": "fbd4e3c6-8e55-4098-b0ff-5e478b6c957e",
     "viewMode": "Site",
     "revision": "12"
   },

   // ...
 }

operation

Additional information about a potentially long-running operation associated with the log entry.

Description

Some operations, such as an HTTP function call or a scheduled task, include several log entries. The operation object lets you identify all log entries associated with a specific operation via the operation ID, which is unique to each operation. You can also use the producer property to identify the context of the operation, such as a URL path for page code or an HTTP function name.

Note

Currently only applicable for log entries with the Corvid namespace.

Syntax

get operation(): LogEntryOperation

Examples

Log entry operation information for page code

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "page:/about", // URL path of page within site
   },

   // ...
 }

Log entry operation information for an HTTP function

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "httpFunction:myFunction",
   },

   // ...
 }

Log entry operation information for a web module function

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "webModule:calculator.jsw/calculate",
   },

   // ...
 }

receiveTimestamp

Time the log entry was received by site monitoring.

Description

Displayed as UTC time in ISO 8601 format.

Syntax

get receiveTimestamp(): string
TYPE
?
The kind of data the property stores.
string

Examples

Log entry receiveTimestamp

{
  // ...

  "receiveTimestamp": "2019-03-31T06:02:12.925Z",

  // ...
}

severity

Severity of the log entry.

Description

One of the following standard severity levels:

  • "INFO": Status, performance, or other general information.
  • "WARNING": An unexpected or undesired development that may cause problems.
  • "ERROR": A serious issue that is likely to cause problems.

Syntax

get severity(): string
TYPE
?
The kind of data the property stores.
string

Examples

Severity level for informational log entry

{
  // ...

  "severity": "INFO",

  // ...
}

Severity level for error log entry

{
  // ...

  "severity": "ERROR",

  // ...
}

sourceLocation

Source code location information associated with the log entry.

Description

Provides location information for source code associated with the log entry.

Note

Currently only applicable for backend log entries with the Corvid namespace.

Syntax

get sourceLocation(): LogEntrySourceLocation

Examples

Log entry source location information for an HTTP function

{
  // ...

  "sourceLocation": {
    "file": "http-functions.js",
    "line": 24
  },

  // ...
}

Log entry source location information for a web module function

{
  // ...

  "sourceLocation": {
    "file": "backend/calculator.jsw", // web module
    "line": 14
  },

  // ...
}

timestamp

Time the site event occurred.

Description

Time the event recorded by the log entry occurred. Displayed as UTC time in ISO 8601 format.

Syntax

get timestamp(): string
TYPE
?
The kind of data the property stores.
string

Examples

Log entry timestamp

{
   // ...

   "timestamp": "2019-03-31T06:02:12.008Z",

   // ...
 }

LogEntryJsonPayload

Payload of the log entry in JSON format.

Syntax

type LogEntryJsonPayload = {
  message: string
}
MEMBERS
?
The properties of an object.
message
string
Payload message.

Examples

Log entry payload information

{
   // ...

   "jsonPayload": {
     "message": "#contactUs button was clicked." // Console log
   },

   // ...
 }

LogEntryLabels

Additional information about the log entry.

Syntax

type LogEntryLabels = {
  siteUrl: string
  namespace: string
  tenantId: string
  viewMode: string
  revision: string
}
MEMBERS
?
The properties of an object.
siteUrl
string
baseUrl of the site with which the log entry is associated.
namespace
string
Name of Wix application with which the log entry is associated, such as Stores or Bookings. The generic namespace Corvid represents site code not associated with a specific Wix application. Currently only the Corvid namespace is supported.
tenantId
string
Unique identifier for the site. Does not change even if the site name or other site attributes change.
viewMode
string

Indicates the viewing mode from which the log entry originates. One of the following:

  • "Preview": Preview mode.
  • "Site": Published site mode.
revision
string
Unique identifier for a specific site revision. You can use the revision property together with the Release Manager to monitor and debug new revisions of your site.

Examples

Log entry labels

{
   // ...

   "labels": {
     "siteUrl": "https://my-site.com",
     "namespace": "Corvid",
     "tenantId": "fbd4e3c6-8e55-4098-b0ff-5e478b6c957e",
     "viewMode": "Site",
     "revision": "12"
   },

   // ...
 }

LogEntryOperation

Additional information about a potentially long-running operation associated with the log entry.

Description

Some operations, such as an HTTP function call or a scheduled task, include several log entries. The Operation object lets you identify all log entries associated with a specific operation via the operation id, which is unique to each operation. You can also use the producer property to identify the context of the operation, such as a URL path for page code or an HTTP function name.

Note

Currently only applicable for log entries with the Corvid namespace.

Syntax

type LogEntryOperation = {
  id: string
  producer: string
}
MEMBERS
?
The properties of an object.
id
string
Unique identifier useful for linking together all log entries associated with a specific operation.
producer
string
Context of the operation, such as a URL path for page code or a web module function name.

Examples

Log entry operation information for page code

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "page:/about", // URL path of page within site
   },

   // ...
 }

Log entry operation information for an HTTP function

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "httpFunction:myFunction",
   },

   // ...
 }

Log entry operation information for a web module function

{
   // ...

   "operation": {
     "id": "1554017373.14484058793726342",
     "producer": "webModule:calculator.jsw/calculate",
   },

   // ...
 }

LogEntrySourceLocation

Source code location information associated with the log entry. Currently only applicable for backend log entries with the Corvid namespace.

Syntax

type LogEntrySourceLocation = {
  file: string
  line: number
}
MEMBERS
?
The properties of an object.
file
string
Name of the source file.
line
number
Line within the source file. 1-based. 0 indicates no line number available.

Examples

Log entry source location information for an HTTP function

{
  // ...

  "sourceLocation": {
    "file": "http-functions.js",
    "line": 24
  },

  // ...
}

Log entry source location information for a web module function

{
  // ...

  "sourceLocation": {
    "file": "backend/calculator.jsw", // web module
    "line": 14
  },

  // ...
}