-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add fileTransport #1189
feat: add fileTransport #1189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I noticed the following on how the logs are saved in the file(s) :
- Whenever the max size of file and max file(s) are reached, the logs are re-written.
- However whenever Sidecar is started again, the logs are appended in the file(s) until the max size file and max files are reached again.
If we would like the log files to be re-written also every time Sidecar starts/runs then we only need to add this line :
options: { flags: 'w' }
when we return the transports.File
.
closes: #1188
Summary
Give users the ability to write logs to a file for better debugging etc.
Env Vars
SAS_LOG_WRITE
: Whether or not to write logs to a log file. Default is set tofalse
. Accepts a boolean value. The log files will be written aslogs.log
. NOTE: Tt will only log what is available depending on whatSAS_LOG_LEVEL
is set to.SAS_LOG_WRITE_PATH
: Specifies the path to write the log files. Default will be where the package is installed.SAS_LOG_WRITE_MAX_FILE_SIZE
: Specifies in bytes what the max file size for the written log files should be. Default is5242880
(5MB).SAS_LOG_WRITE_MAX_FILES
: Specifies how many files can be written. Default is 5.