From 4a18e5ed0f5a5a9d1539ed965d7f8146bda5f09f Mon Sep 17 00:00:00 2001 From: Venkateswarlu Ganji Date: Tue, 23 Jul 2024 17:55:16 +0530 Subject: [PATCH] docs: update README --- README.md | 1 + docs/custom-logging-functions.md | 83 -------------------------------- 2 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 docs/custom-logging-functions.md diff --git a/README.md b/README.md index be06226..fccf682 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ A Node.js app using Errsole Logger can handle 90,000 more requests per minute th * [Errsole with PostgreSQL](https://github.com/errsole/errsole.js/blob/master/docs/postgresql-storage.md) * [Errsole with MariaDB](https://github.com/errsole/errsole.js/blob/master/docs/mariadb-storage.md) * [Errsole with OracleDB](https://github.com/errsole/errsole.js/blob/master/docs/oracledb-storage.md) +* [Advanced Configuration](https://github.com/errsole/errsole.js/blob/master/docs/advanced-configuration.md) ## Web Dashboard Access diff --git a/docs/custom-logging-functions.md b/docs/custom-logging-functions.md deleted file mode 100644 index a195afe..0000000 --- a/docs/custom-logging-functions.md +++ /dev/null @@ -1,83 +0,0 @@ -# Custom Logging Functions - -### log / info - -The log function is used to log messages or information. It can accept one or more arguments, which can be strings, numbers, JavaScript objects, or Error objects. - -#### Example - -```javascript -errsole.log('Logging a message'); -errsole.log('Multiple', 'arguments', 'are supported'); -errsole.log('Logging with a variable:', var1); -errsole.log(new Error('An error occurred')); -errsole.log('Logging with an error object:', errorObject); -``` - -```javascript -errsole.info('Logging a message'); -errsole.info('Multiple', 'arguments', 'are supported'); -errsole.info('Logging with a variable:', var1); -errsole.info(new Error('An error occurred')); -errsole.info('Logging with an error object:', errorObject); -``` - -### alert - -The alert function logs a message and sends a notification to configured channels, such as Email or Slack. It accepts the same types of arguments as the log function. - -#### Example - -```javascript -errsole.alert('Alert! Something critical happened'); -``` - -### error - -The error function is specifically designed to log errors. It accepts the same types of arguments as the log function. - -#### Example - -```javascript -errsole.error(new Error('An error occurred')); -``` - -### warn - -The warn function is used to log warning messages. It accepts the same types of arguments as the log function. - -#### Example - -```javascript -errsole.warn('This is a warning message'); -``` - -### debug - -The debug function logs debug information, typically used for troubleshooting during development. It accepts the same types of arguments as the log function. - -#### Example - -```javascript -errsole.debug('Debugging information'); -``` -### meta - -In Errsole's custom logger, you can include metadata with your logs. This metadata can be any contextual information, such as HTTP requests or database query results. In the Errsole Web Dashboard, you can view this metadata in a clean JSON viewer without cluttering the log messages. - -To include metadata in your logs, use the `meta` function followed by the appropriate logging function (error, log, etc.). - -#### Example - -```javascript -errsole.meta({ reqBody: req.body, queryResults: results }).error(err); -errsole.meta({ email: req.body.email }).log('User logged in'); -``` - -#### Note - -The `meta` function must be the first function in the chain, followed by the desired logging function. - -## Main Documentation - -[Main Documentation](/README.md) \ No newline at end of file