Logging with Hub v1
Sentry, Google Analytics, and New Relic support
Hub v1 offers support to the main logging resources through HubCommon, importing the Logger object from hub/utils/logger
#
Main API#
Initializing the loggerThe logger class will be initialized by default using the (Sentry Hub Project) DSN and (New Relic) Application IDs
init(options)
: set the options that will be used for Sentry, and New Relic.dsn
(string) start with a default Hub DSNreleaseName
(string) defaults toHub v1
releaseId
(string) defaults toHubCommon 5
debug
(boolean) will run Sentry and New Relic for localhost for debugapplicationID
(string) to set a custom application id to be used by new relicdisableNewRelic
(boolean) to not run new relic for your app- all options can be overrided for each Hub v1 app
Other methods avaliable: setReleaseName, setReleaseId, setDebug, overrideDefaultErrorHandlers
#
SentryTo setup your own Sentry project, see the Sentry Guide
Sentry.setupSentry({dsn, release, debug})
starts up the Sentry configuration, setting the Enviroment. Will not run for localhost.Sentry.setUserContext(UserContext)
sets the information for which user got the error (to investigate a possible permission issue). It is set by default using the logged user.Other Sentry APIs avaliable: captureException, captureMessage, addBreadcrumb
#
New RelicEnables the possibility to set your own application id
#
Google AnalyticsTo setup your own Google Analytics views, see the Configuring Analytics Guide
Set the default Hub Google Analytics ID (UA-53263868-10)
Set default page view
app.on('change', Backbone.History)
Create function
initialize(code)
to set your own GA code instead of changing the index.htmlSend events: