Namespace: Handler

Canadarm. Handler

Source:

Methods

<static> beaconLogHandler(beaconURL)

Beacon log handler. Uses a configured beacon file to get logs to a remote logging location.
Parameters:
Name Type Description
beaconURL string The URL to send logs.
Source:
Returns:
a function that takes an attribute object for logging.
Example
  Canadarm.addHandler(Canadarm.Handler.beaconLogHandler('http://example.com/to/beacon.gif'));

  // If you use an access_combined log format for the beacon you will see something like:
  10.162.143.4 - - [21/Apr/2015:16:07:59 -0500] "GET ?characterSet=UTF-8%0A&columnNumber=%3F%0A&language=en-US...

<static> consoleLogHandler(logAttributes)

Console log handler. Outputs logs to console.
Parameters:
Name Type Description
logAttributes object the attributes to log, key/value pairs, no nesting.
Source:
Example
  Canadarm.addHandler(Canadarm.Handler.consoleLogHandler);

  // In Chrome the output looks similar to:
  [ERROR]: two is not defined
  characterSet: "windows-1252"
  columnNumber: "17"
  language: "en-US"
  lineNumber: "17"
  logDate: "2015-04-22T21:35:40.389Z"
  msg: "[ERROR]: two is not defined"
  pageURL: "http://localhost:8000/html/"
  scriptURL: "http://localhost:8000/js/broken.js"
  stack: "ReferenceError: two is not defined↵
      at broken_watched_function (http://localhost:8000/js/broken.js:17:17)↵
      at wrapper (http://localhost:8000/js/canadarm.js:616:17)↵
      at http://localhost:8000/js/broken.js:60:40
  "type: "jserror"