Advanced Configuration in Node.js


Sqreen settings can be optionally adjusted according to your needs. This section lists the possible configuration options you have with Sqreen Node.js agent.

Configuration sources

The Sqreen Agent read its configuration from different places: * The environment * A JSON file

The JSON file can be located in: * Your application top level directory: sqreen.json * In a custom place set by SQREEN_CONFIG_FILE environment variable:

export SQREEN_CONFIG_FILE=/custom/path/sqreen.json 

Configuration variables

The Sqreen agent can be configured using the environment or a JSON file. Here are the settings that can be changed:

Env variable name Role JSON key name Default value
SQREEN_TOKEN The Sqreen token. This identifies the agent to Sqreen backend servers token Empty
SQREEN_CONFIG_FILE Custom location for the JSON based config Empty
SQREEN_LOG_LOCATION Specify a custom file to write Sqreen logs log_location log/sqreen.log
SQREEN_LOG_LEVEL Sqreen logging level log_level WARN
SQREEN_HTTP_PROXY HTTP proxy server http_proxy Empty
SQREEN_IP_HEADER Specify the header to use to find the real IP address of a client ip_header Empty
SQREEN_STRIP_SENSITIVE_DATA Remove sensitive data before sending them to Sqreen BackEnd strip_sensitive_data 1
SQREEN_APP_ROOT Declare custom root directory for project app_root process.cwd()