Skip to content
@iDoMeteor edited this page Mar 6, 2016 · 2 revisions

Log Menu

While in the #OnePageWonder editor, click on the 'Logs' button and you will be presented with a clickable list of the available logs, each with a badge indicating the number of unread entries.

Commonalities

Log entries are generally consolidated into one line containing the most pertinent information, accompanied by a data toggle and a mark as read feature.

Mark as Read

Clicking a log entry will mark it as read and remove it from your active view, unless you are in the raw log menu in which case you intentionally are lacking the mark as read feature (otherwise it wouldn't be raw anymore!).

Data Toggle

Clicking the little arrow will expand a new row containing the entire log object, as a nicely nested set of key/value pairs. Click the little arrow again to contract it.

Debug Messages

Logs with type 'debug' are never saved to the database. They are only logged to the client console if the configuration option clientSideConsoleLogs is set to true.

Admin Notifications

Any OPW.log({}) calls with notifyAdmin set to true will generate an entry in the admin notification log. If so configured, it will also send the admin an email.

Authentication Logs

Log events with the other property set to true will show up in the authentication logs. All successful and failed logins via the modal authentication window are logged by default.

Contact Requests

Contact request logs are detailed on the contact system page.

Raw Logs

Raw logs are a straight unfiltered query of the log database, in reverse chronological order. They do not have a mark as read feature.

Security Logs

Security logs are triggered when the 'security' property of the log object is set to true.

Example Log Object

{
  // Document ID in the database
  "_id": "f6dS4qKmTHMM78BPA",
  // Message passed to logger
  "message": "Authentication failed.",
  // Pertinent data related to the request, may or may not be present, varying formats
  "data": {
    "email": "admin",
    "error": {
      "error": 403,
      "reason": "Incorrect password",
      "message": "Incorrect password [403]",
      "errorType": "Meteor.Error"
    }
  },
  // Time stamp of event
  "date": "2016-02-23T18:50:25.675Z",
  // Add to admin log & email admin if OPW is configured to do so
  "notifyAdmin": true,
  // Will pop an alert for the user when incurred by a client-side event
  "notifyUser": true,
  // Will send the event to Google Analytics (GA) if native GA is enabled
  "sendEvent": true,
  // GA event tag
  "eventTag": "Login Failure",
  // Whether or not this was an authentication event
  "auth": true,
  // Whether or not this was a security event
  "security": true,
  // Log type (one of: debug, info, success, failure, error, danger, etc)
  "type": "danger",
  // Determines background color of user alert, a sub-set of type auto-determined by said type
  "alertType": "danger"
}

Clone this wiki locally