-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from itallorian/feature/delivery
docs and tests
- Loading branch information
Showing
5 changed files
with
33 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,10 @@ | ||
|
||
# New Relic Integration | ||
 | ||
|
||
This solution offers a flexible and efficient approach to integrating systems with New Relic's powerful monitoring platform via API. | ||
|
||
## Installation | ||
|
||
You can install the library using the following command: | ||
|
||
```bash | ||
npm install itallorian-newrelic | ||
``` | ||
|
||
## **Usage Examples:** | ||
|
||
```markdown | ||
const irNewRelic = require('itallorian-newrelic'); | ||
|
||
// Example 1 | ||
irNewRelic.Log("Your Log Message"); | ||
# New Relic Integration [@itallorian](https://github.com/itallorian) | ||
|
||
// Example 2 | ||
irNewRelic.Log("Your Error Log Message", irNewRelic.LogLevel.ERROR); | ||
``` | ||
|
||
## **Detailed Documentation:** | ||
   | ||
|
||
This solution offers a flexible and efficient approach to integrating systems with New Relic's powerful monitoring platform via API. | ||
|
||
### `Log(message, level)` | ||
|
||
The `Log` method takes two parameters: `message` and `level`. The `message` parameter is the log message to be logged, and the `level` parameter is the log level. If no level is provided, it defaults to `LogLevel.DEBUG`. | ||
|
||
Inside the `Log` method, a object is created with the following properties: | ||
|
||
- `timestamp`: the current time in milliseconds since the Unix Epoch. | ||
- `message`: the processed log message. | ||
- `level`: the log level. | ||
- `service`: the name of the service, taken from constants. | ||
- `hostname`: the name of the host, taken from constants. | ||
|
||
This object is then sent to New Relic, a real-time monitoring service. | ||
|
||
### `LogLevel` | ||
**LogLevel** is an object with this options. | ||
|
||
- `DEBUG`: Used for detailed information on the flow through the system. | ||
|
||
- `INFO`: Used to confirm that things are working as expected. | ||
|
||
- `WARN`: Used to indicate that something unexpected happened, or there | ||
might be a problem in the near future (e.g., 'disk space low'). The | ||
software is still working as expected. | ||
|
||
- `ERROR`: Used to indicate that the software has not been able to | ||
perform some function. | ||
Find all information on our wiki [here](https://github.com/itallorian/newrelic/wiki) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters