diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-18 21:05:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 21:05:29 +0200 |
commit | 207ce73a9a106aeee70fe75c94a278785a278c60 (patch) | |
tree | a3085912dd649dd0647ff2eae08582b902735db2 | |
parent | Merge pull request #375 from TheArcaneBrony/request-logging (diff) | |
parent | Fix environment variable name to work on non-Windows platforms (diff) | |
download | server-207ce73a9a106aeee70fe75c94a278785a278c60.tar.xz |
Merge pull request #377 from TheArcaneBrony/request-logging
Fix environment variable name to work on non-Windows platforms
-rw-r--r-- | api/src/Server.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/api/src/Server.ts b/api/src/Server.ts index bda19db5..4a226d12 100644 --- a/api/src/Server.ts +++ b/api/src/Server.ts @@ -40,22 +40,22 @@ export class FosscordServer extends Server { /* - DOCUMENTATION: uses log-requests environment variable + DOCUMENTATION: uses LOG_REQUESTS environment variable # only log 200 and 204 - log-requests=200 204 + LOG_REQUESTS=200 204 # log everything except 200 and 204 - log-requests=-200 204 + LOG_REQUESTS=-200 204 # log all requests - log-requests=- + LOG_REQUESTS=- */ - - let logRequests = process.env["log-requests"] != undefined; + + let logRequests = process.env["LOG_REQUESTS"] != undefined; if(logRequests) { this.app.use(morgan("combined", { skip: (req, res) => { - var skip = !(process.env["log-requests"]?.includes(res.statusCode.toString()) ?? false); - if(process.env["log-requests"]?.charAt(0) == '-') skip = !skip; + var skip = !(process.env["LOG_REQUESTS"]?.includes(res.statusCode.toString()) ?? false); + if(process.env["LOG_REQUESTS"]?.charAt(0) == '-') skip = !skip; return skip; } })); @@ -91,7 +91,7 @@ export class FosscordServer extends Server { TestClient(this.app); if(logRequests){ - console.log("Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'log-requests' environment variable!"); + console.log("Warning: Request logging is enabled! This will spam your console!\nTo disable this, unset the 'LOG_REQUESTS' environment variable!"); } return super.start(); } |