Repository navigation
fix: drive file logs - #1395
fix: drive file logs#1395
Conversation
| const drivePrettyFilePath = homeDir.joinPath('logs', config.getName(), 'drive-pretty.log'); | ||
| config.set('platform.drive.abci.log.prettyFile.path', drivePrettyFilePath); | ||
|
|
||
| const driveJsonFilePath = homeDir.joinPath('logs', config.getName(), 'drive-json.log'); |
There was a problem hiding this comment.
Did you test it with max_files > 0 ? AFAIR you can kill -HUP drive-abci to force log rotation.
For max_files == 0 HUP executes flush() so should be called as part of external logrotate
There was a problem hiding this comment.
Nope, I didn't test. In deployment tool we use external log rotate. Do you think we should expose flush command for Drive so log rotate will call it? Do you think it's a big deal? In worst case scenario we just add lines to new file instead of old one.
There was a problem hiding this comment.
Looks like with logrotate, we need to handle this signal a bit different - close and recreate the file; otherwise writes could still go to old file, regardless of the move done by logrotate.
There was a problem hiding this comment.
And your change might be a breaking change for max_files > 0 - I mean, it can stop working. That's why I suggested this test.
| destination: String::from("stderr"), | ||
| verbosity: 0, | ||
| color: None, | ||
| destination: LOG_DESTINATION_STDOUT.to_string(), |
There was a problem hiding this comment.
what do you think about using LogDestination::name(&LogDestination::StdOut); instead of constants?
There was a problem hiding this comment.
We can do it but then we need to change LogDestination::Bytes name to "bytes", or change destination config option to "ByteBuffer". What do you prefer?
There was a problem hiding this comment.
#[cfg(test)]
// Just some bytes, for testing
Bytes(Writer<Vec<u8>>),
I don't care, as this is only for testing. Can be ByteBuffer.
There was a problem hiding this comment.
It works for StdErr and StdOut because these variants don't have params but doesn't work for Bytes since it requires Writer so you can't do LogDestination::name(&LogDestination::Bytes);
Issue being fixed or feature implemented
After switching JS Drive to RS Drive the ABCI log file configuration has not been working in dashmate.
What was done?
How Has This Been Tested?
Manually
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only