forked from zeropoolnetwork/zeropool-relayer
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the devel branch into the main branch, v3.1.0
This merge contains the following set of changes: - Add debug log for RPC request errors (#131) - Add internal account validation (#135) - Add counter exceeded check for re-sent iterations (#138) - Improvement of logging requests to relayer (#140) - Fix failed contract calls (#145)
- Loading branch information
Showing
14 changed files
with
176 additions
and
66 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
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
import winston from 'winston' | ||
import { format, transports } from 'winston' | ||
import expressWinston from 'express-winston' | ||
import config from '@/config' | ||
import { logger } from './appLogger' | ||
|
||
export function createLoggerMiddleware(filename: string = 'zp.log') { | ||
export function createPersistentLoggerMiddleware(filename: string = 'zp.log') { | ||
return expressWinston.logger({ | ||
transports: [new winston.transports.File({ filename })], | ||
format: winston.format.combine(winston.format.json()), | ||
transports: [new transports.File({ filename })], | ||
format: format.combine(format.json()), | ||
}) | ||
} | ||
|
||
export function createConsoleLoggerMiddleware() { | ||
return expressWinston.logger({ | ||
winstonInstance: logger, | ||
level: 'debug', | ||
ignoredRoutes: config.logIgnoreRoutes, | ||
headerBlacklist: config.logHeaderBlacklist, | ||
requestWhitelist: ['headers', 'httpVersion'], | ||
}) | ||
} |
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.