-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add fileTransport for local logging * lint * add env vars to SidecarConfig * add logic to transport logger * adjust logging * update log config * add WRITE_MAX_FILE_SIZE and WRITE_MAX_FILES * update the docs * cleanup some grumbles * update readme
- Loading branch information
Showing
9 changed files
with
118 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ yarn-error.log | |
/.clinic | ||
**.log | ||
**/logs | ||
|
||
# Yarn berry | ||
.yarn/* | ||
!.yarn/releases | ||
!.yarn/plugins | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { transports } from 'winston'; | ||
|
||
import { SidecarConfig } from '../../SidecarConfig'; | ||
|
||
export const fileTransport = ( | ||
fileName: string | ||
): transports.FileTransportInstance => { | ||
return new transports.File({ | ||
level: SidecarConfig.config.LOG.LEVEL, | ||
filename: `${SidecarConfig.config.LOG.WRITE_PATH}/${fileName}`, | ||
handleExceptions: true, | ||
maxsize: SidecarConfig.config.LOG.WRITE_MAX_FILE_SIZE, | ||
maxFiles: SidecarConfig.config.LOG.WRITE_MAX_FILES, | ||
}); | ||
}; |
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