-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,376 additions
and
902 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# LogEntries Appender | ||
|
||
Sends log events to a [Insight](https://www.rapid7.com/products/) server. | ||
|
||
```bash | ||
npm install --save @tsed/logger-insight | ||
``` | ||
|
||
## Configuration | ||
|
||
* `type` - `insight` | ||
* `options.token` - LogEntries token | ||
* `options.region` - The region of ingestion endpoint to be used. Examples: `eu`, `us` etc. | ||
|
||
See all available options for Insight [here](https://www.npmjs.com/package/r7insight_node). | ||
|
||
## Example | ||
|
||
```typescript | ||
import {Logger} from "@tsed/logger"; | ||
import "@tsed/logger-logentries" | ||
|
||
const logger = new Logger("loggerName"); | ||
|
||
logger.appenders.set("stdout", { | ||
type: "logentries", | ||
level: ["info"], | ||
options: { | ||
token: "the token", | ||
region: "us" | ||
// other options of logentries | ||
} | ||
}); | ||
``` |
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "@tsed/logger-insight", | ||
"version": "5.8.0", | ||
"description": "Insight appender module for @tsed/logger", | ||
"main": "./lib/index.js", | ||
"typings": "./lib/index.d.ts", | ||
"private": false, | ||
"author": { | ||
"name": "Romain Lenzotti" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/TypedProject/logger.git" | ||
}, | ||
"keywords": [ | ||
"ts", | ||
"log", | ||
"debug", | ||
"typescript", | ||
"trace", | ||
"insight" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/TypedProject/logger/issues" | ||
}, | ||
"homepage": "https://github.com/TypedProject/logger", | ||
"scripts": { | ||
"build": "tsc --build tsconfig.compile.json" | ||
}, | ||
"dependencies": { | ||
"@tsed/logger": "5.8.0", | ||
"r7insight_node": "2.1.0" | ||
}, | ||
"devDependencies": {}, | ||
"peerDependencies": {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# @tsed/logger-insight | ||
|
||
[![Build Status](https://travis-ci.org/TypedProject/logger.svg?branch=master)](https://travis-ci.org/TypedProject/logger) | ||
[![Coverage Status](https://coveralls.io/repos/github/TypedProject/logger/badge.svg?branch=master)](https://coveralls.io/github/TypedProject/logger?branch=master) | ||
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=100)](https://github.com/ellerbrock/typescript-badges/) | ||
[![npm version](https://badge.fury.io/js/%40tsed%2Flogger.svg)](https://badge.fury.io/js/%40tsed%2Flogger) | ||
[![Dependencies](https://david-dm.org/TypedProject/logger.svg)](https://david-dm.org/TypedProject/logger#info=dependencies) | ||
[![img](https://david-dm.org/TypedProject/logger/dev-status.svg)](https://david-dm.org/TypedProject/logger/#info=devDependencies) | ||
[![img](https://david-dm.org/TypedProject/logger/peer-status.svg)](https://david-dm.org/TypedProject/logger/#info=peerDependenciess) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/TypedProject/logger/badge.svg)](https://snyk.io/test/github/TypedProject/ts-express-decorators) | ||
|
||
<p style="text-align: center" align="center"> | ||
<a href="https://tsed.io" target="_blank"><img src="https://tsed.io/tsed-og.png" width="200" alt="Ts.ED logo"/></a> | ||
</p> | ||
|
||
A package of Ts.ED logger framework. | ||
|
||
## Features | ||
|
||
Sends log events to an [Insight](https://www.rapid7.com/products/) server. | ||
|
||
## Installation | ||
|
||
``` | ||
npm install --save @tsed/logger-insight | ||
``` | ||
|
||
## Configuration | ||
|
||
* `type` - `insight` | ||
* `options.token` - Insight token | ||
* `options.region` - The region of ingestion endpoint to be used. Examples: `eu`, `us` etc. | ||
|
||
See all available options for LogEntries [here](https://www.npmjs.com/package/r7insight_node). | ||
|
||
## Example | ||
|
||
```typescript | ||
import {Logger} from "@tsed/logger"; | ||
import "@tsed/logger-insight" | ||
|
||
const logger = new Logger("loggerName"); | ||
|
||
logger.appenders.set("stdout", { | ||
type: "insight", | ||
level: ["info"], | ||
options: { | ||
token: "the token", | ||
region: "eu" | ||
// other options of logentries | ||
} | ||
}); | ||
``` | ||
|
||
## Backers | ||
|
||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)] | ||
|
||
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a> | ||
|
||
|
||
## Sponsors | ||
|
||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)] | ||
|
||
## License | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 - 2018 Romain Lenzotti | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {$log, Appender, LogEvent, BaseAppender} from "@tsed/logger"; | ||
import Insight from "r7insight_node"; | ||
|
||
@Appender({name: "insight"}) | ||
export class InsightAppender extends BaseAppender { | ||
private logger: any; | ||
|
||
build() { | ||
if ($log.level !== "OFF") { | ||
this.logger = new Insight(this.config.options); | ||
} | ||
} | ||
|
||
write(loggingEvent: LogEvent) { | ||
const level = loggingEvent.level.toString().toLowerCase(); | ||
|
||
if (level !== "off" && this.logger[level]) { | ||
this.logger[level](this.layout(loggingEvent, this.config.timezoneOffset)); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./InsightAppender"; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "../../tsconfig.compile.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "lib" | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"test", | ||
"lib" | ||
] | ||
} |
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
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
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
Oops, something went wrong.