feature/IO-3029-Enhanced-Logging-File-Based: Add fix bugs
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -54,6 +54,8 @@ router.get("/test-logs", eventAuthorizationMiddleware, (req, res) => {
|
||||
|
||||
// Test 4: Log with a message that doesn't exceed the size limit and doesn't require an upload.
|
||||
logger.log("Normal log entry", "debug", "user123", { id: 4 }, { detail: "normal log entry" });
|
||||
|
||||
return res.status(500).send("Logs tested.");
|
||||
});
|
||||
|
||||
// Search
|
||||
|
||||
@@ -191,7 +191,13 @@ const createLogger = () => {
|
||||
return false;
|
||||
};
|
||||
|
||||
if (upload || checkAndUploadLog()) return;
|
||||
// Upload log immediately if upload is true, otherwise check the log size.
|
||||
if (upload) {
|
||||
uploadLogToS3(logEntry, message, type, user);
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkAndUploadLog()) return;
|
||||
|
||||
winstonLogger.log(logEntry);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user