Logging
Logging is controlled by the LOG_LEVEL
parameter in the .env
. There are 5 levels of logging available. Setting a log level will include all message in a level above (so setting LOG_LEVEL=WARN
will also log ERROR
and FATAL
messages.
FATAL
: This is an issue that cannot be recovered from. Examples would include trying to start the service on a port that is already taken.ERROR
: This is an issue that does not cause the entire system to fail (but will often cause a particular request to fail). Examples would include a failure to reach Rx-Universe on a particular request.WARN
: This is an issue that does not cause a failure, but should be noted anyways. We do not currently produceWARN
-level statements but in the future we might generate a warning if, for example, a request asks for a very large range of data.INFO
: This is any non-issue that might be of interest. An example is logging the time, url, and IP address for each request made to the API.DEBUG
: This is verbose information that would typically be used for in-depth tracing. If this is turned on log files will tend to grow very large very quickly.
If no LOG_LEVEL
is set in the .env
then WARN
will be used. If the .env
is changed then the windows service must be restarted before the change takes effect.
Logs are written to \logs\production.log
(so if the API is installed in c:\sites\api
then the file will be c:\sites\api\logs\production.log
The log is rotated daily, meaning the current file will be named production.log.yyyymmdd
(e.g. production.log.20211216
if the day is December 16, 2021) and a new production.log
will be created.