ScreenAbort

The ScreenAbort appender is designed to use with remote access tools such as a Postman. Its main purpose is to return dump() output to the client so the error message can be viewed as if the user was viewing the call from a browser.

Configuration

The ScreenAbort appender is active by default and can be used with no properties.

Note: This WILL abort processing the page and immediately return the call. See tips below for recommendations

appenders : {
   "screenDump"  : { "class" : "scribe.models.screenDump" }
}

Tips and Recommendations

  • Use in conjunction with an http header which is sent from your client. For example, create a header called "x_DebugHeader and then in the RuleDefinitions include ["headerTrueFalse":"x-DebugHeader"]. This will check for the presence of the http header and route any errors accordingly.

  • Only use for Fatal or Error level logging. Otherwise every info comment will abort your flow.

  • When used in a series of apenders, put this last on the list otherwise the other appenders will not run. See below for example

Example Configuration

"ruleDefinitions" : [
    "headerTrueFalse:X-Import-Debug",
    "severity:severity"
],
rules : { 
    "true" : {
      "fatal" : [ "scribeConsole", "screenAbort" ],
      "error" : [ "scribeConsole", "screenAbort" ],
      "warn"  : [ "scribeConsole" ],
      "info"  : [ "scribeConsole" ],
      "debug" : [ "scribeConsole" ] 
    }
}

Last updated