Logging and error reporting
HydraExpress includes alog
member which allows you to log into to both the console and log file.
hydraExpress.log('error', message);
The first parameter tolog
is the type of log message:fatal
,error
,debug
orinfo
. The second parameter is the string message to store. It's highly recommended that you take the opportunity to create highly descriptive log messages since this function doesn't log a stack trace.
Additionally, log messages of typefatal
orerror
are sent to hydra-core for logging inside of the services health check log. See:https://github.com/flywheelsports/hydra#health-and-presence