BoxLang 🚀 A New JVM Dynamic Language Learn More...
A easy to use Healthcheck module
By default, the Healthcheck logs all fails for all sections. Once that is complete, it will check which categories of errors you would throw for, and then if one of those has errors, it will throw that error and fail the healthcheck.
The module will report any error using the Logger selected (if you enable it).
The default logger is Sentry. You can change the wirebox mapping for the Logger by changing the logger
setting in your configuration. You can also set the method for calling on your logger, and the message key and extra info.
The default is sentry
logger: "SentryService@sentry",
loggerMethod: "captureException",
loggerMessageKey: "message",
loggerExtraInfoKey: "exception",
If you wanted to use a logbox logger, you could use the following
logger: "logbox:logger: {this}",
loggerMethod: "warn",
loggerMessageKey: "message",
loggerExtraInfoKey: "extraInfo",
loggerEnabled=0
to disable on a call by call basisloggerEnabled
setting in your ColdBox config.Healthcheck only fails if you have 1 or more Errors in one of the categories, you have selected to throw / fail the healthcheck for.
throwOnCachesErrors: false,
throwOnCouchbaseServersErrors: false,
throwOnDBErrors: false,
throwOnServiceErrors: true,
throwOnSiteErrors: false,
appName: "Gavin's Blog",
logger: "SentryService@sentry",
loggerEnabled: true,
loggerMethod: "captureException",
loggerMessageKey: "message",
loggerExtraInfoKey: "exception",
throwOnCachesErrors: false,
throwOnCouchbaseServersErrors: false,
throwOnDBErrors: false,
throwOnServiceErrors: true,
throwOnSiteErrors: false,
cachesRequired = [
{ cacheName: "template", testVariableName: "TemplateTestValue", testValue: "Brad Wood" },
{ cacheName: "session", testVariableName: "SessionTestValue", testValue: "Gavin Pickin" }
],
couchBaseServersToCheck: [
"127.0.0.100",
"127.0.0.101",
],
dbs: [
{
"group_name": "Main Application",
"datasources": [
{ datasource: "applicationDB", columnName: "id", tableName: "users" }
{ datasource: "loggingDB", columnName: "id", tableName: "email_logs" }
{ datasource: "backupDB", columnName: "id", tableName: "users" }
]
}
],
wireboxDslsToVerify: [
{ "dsl": "quickService:user@core", "type": "component" },
{ "dsl": "UnleashSDK@unleashsdk", "type": "component" },
{ "dsl": "JwtService@cbsecurity", "type": "component" },
{ "dsl": "cbSecurity@cbSecurity", "type": "component" },
{ "dsl": "FirebaseService@apiv1", "type": "component" },
{ "dsl": "coldbox:setting: firebasePrivateKey", "type": "String", "required": true },
{ "dsl": "coldbox:setting: firebaseScope", "type": "String", "required": true },
{ "dsl": "coldbox:setting: apiRateLimit", "type": "Double", "required": true }
],
externalSites: []
appName: "Unknown App",
logger: "SentryService@sentry",
loggerEnabled: true,
loggerMethod: "captureException",
loggerMessageKey: "message",
loggerExtraInfoKey: "exception",
throwOnCachesErrors: false,
throwOnCouchbaseServersErrors: false,
throwOnDBErrors: false,
throwOnServiceErrors: true,
throwOnSiteErrors: false,
cachesRequired = [],
couchBaseServersToCheck: [],
dbs: [
{
"group_name": "Main Application",
"datasources": []
}
],
wireboxDslsToVerify: [],
externalSites: []
$
box install cbHealthcheck