From 666bdef98f41eba3cb34e1e8d268792d07bf61e5 Mon Sep 17 00:00:00 2001 From: niro2-1 Date: Tue, 2 Jun 2026 10:57:01 +0300 Subject: [PATCH] Update error logging information in README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1bf579b..70c8284 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,17 @@ To handle 500 errors effectively: - Log the error details for debugging purposes. - Return a user-friendly error message to the client without exposing sensitive information. +#### Enhanced Logging +Consider using a logging library to manage logs more effectively. This can help in categorizing logs, setting log levels, and storing logs in a centralized location. + Example: ```javascript app.get('/api/resource', (req, res) => { try { // Code that may throw an error } catch (error) { - console.error(error); + logger.error(error); // Using a logging library res.status(500).send('Internal Server Error'); } }); -``` \ No newline at end of file +```