Add ability to enable / disable access log.

In high frequency environments it can be a little bit noisy.
This commit is contained in:
2023-10-09 08:41:05 +01:00
parent b89053c015
commit 743eed7f71
4 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ func processGraphQLRequest(c *fiber.Ctx) error {
}
time_taken := time.Since(t)
cfg.Logger.Info("Request processed", map[string]interface{}{"ip": c.IP(), "user_id": extracted_user_id, "op_type": opType, "op_name": opName, "time": time_taken, "cache": was_cached})
if cfg.Server.AccessLog {
cfg.Logger.Info("Request processed", map[string]interface{}{"ip": c.IP(), "user_id": extracted_user_id, "op_type": opType, "op_name": opName, "time": time_taken, "cache": was_cached})
}
cfg.Monitoring.Increment(libpack_monitoring.MetricsSucceeded, nil)
labels := map[string]string{