How to set up Sentry to log errors in FTW
This guide documents how to use Sentry to log errors in Flex Template for Web (FTW).
FTW supports error logging with Sentry out of the box provided that required environment variables are set in place. Other logging solutions can also be used but the Sentry client comes already strapped into application.
To enable the Sentry error logging a DSN, Data Source Name has to be
provided as an environment variable. Browser and Node environments both
use the same
The DSN key can be aquired from the Sentry project settings. To test it
in your local environment it can be passed for example to the
yarn run dev-server command:
REACT_APP_SENTRY_DSN='<sentry-dsn>' yarn run dev-server
If the Sentry DSN key is not provided the template app will log errors to the console. The logging and Sentry setup is implemented in src/util/log.js and server/log.js so refer to those files to change the external logging service or the logging logic in general.
For basic auth the security token can be configured as follows:
In Project > Settings > General > Client Security set the following values
- Security token -
Basic <your username:password in Base 64>
- Security token header -