-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
442331d
commit 9d9d190
Showing
3 changed files
with
23 additions
and
9 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
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,14 +1,26 @@ | ||
import winston from "winston"; | ||
const { combine, timestamp, json } = winston.format; | ||
|
||
/* Example logger with custom formatter | ||
https://github.com/winstonjs/winston#combining-formats | ||
const { combine, timestamp, label, prettyPrint } = winston.format; | ||
const logger = winston.createLogger({ | ||
level: "info", | ||
format: combine(timestamp(), json()), | ||
transports: [ | ||
new winston.transports.File({ | ||
filename: "ethereal-nexus.log" | ||
}), | ||
], | ||
format: combine( | ||
label({ label: "NextJs NR Integration" }), | ||
timestamp(), | ||
prettyPrint() | ||
), | ||
transports: [new winston.transports.Console()], | ||
}); | ||
*/ | ||
|
||
/* Example logger outputing to the console without formatting | ||
const logger = winston.createLogger({ | ||
transports: [new winston.transports.Console()], | ||
}); | ||
*/ | ||
|
||
// thsi will simply send logs to NR without outputting to the console | ||
// best for prod environments | ||
const logger = winston.createLogger(); | ||
|
||
export { logger }; |