Merge pull request #1844 from thomasdarimont/issue/honor-machine-storage-path-for-vboxlogs

Honor MACHINE_STORAGE_PATH environment for virtualBoxLogs
This commit is contained in:
French Ben 2016-07-26 11:46:20 -07:00 committed by GitHub
commit ba7fb1fc84
1 changed files with 8 additions and 1 deletions

View File

@ -177,7 +177,14 @@ var DockerMachine = {
} }
}, },
virtualBoxLogs: function (machineName = this.name()) { virtualBoxLogs: function (machineName = this.name()) {
let logsPath = path.join(util.home(), '.docker', 'machine', 'machines', machineName, machineName, 'Logs', 'VBox.log');
var logsPath = null;
if (process.env.MACHINE_STORAGE_PATH) {
logsPath = path.join(process.env.MACHINE_STORAGE_PATH, 'machines', machineName, machineName, 'Logs', 'VBox.log');
} else {
logsPath = path.join(util.home(), '.docker', 'machine', 'machines', machineName, machineName, 'Logs', 'VBox.log');
}
let logData = null; let logData = null;
try { try {
logData = fs.readFileSync(logsPath, 'utf8'); logData = fs.readFileSync(logsPath, 'utf8');