Skip to content
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

Exceptions not captured in Boxstarter.log #33

Closed
jreadytalk opened this issue Nov 11, 2014 · 3 comments
Closed

Exceptions not captured in Boxstarter.log #33

jreadytalk opened this issue Nov 11, 2014 · 3 comments

Comments

@jreadytalk
Copy link

I noticed red text scroll by in PowerShell while my script was running in a VM. Boxstarter.log had no record of it. I deduced it was the following call because the file being downloaded was incomplete/corrupt:

(New-Object System.Net.WebClient).DownloadFile($url, $destination)

I tried doing a manual throw in PowerShell, and it didn't get captured either. Is boxstarter.log supposed to capture exception output? It would be nice if it did.

Details that might be pertinent: The starting script installs Chocolatey and Boxstarter, builds NuGet packages from .ps1 files using New-PackageFromScript, then installs them all via a single call to Install-BoxstarterPackage. Packages avoid re-running lots of code after each reboot. Each of the packages sets $Boxstarter.log to c:\vagrant, a directory shared with the host machine.

@mwrock
Copy link
Member

mwrock commented Nov 11, 2014

It should definitely be logging errors. Thats certainly the intent at least. A few questions:

  1. Do you see log files in c:\vagrant?
  2. Have you checked the the former log directory? $boxstarter.log was not intended to be changed. Its absolutely a sensible thing to want but its not at all tested and its possible changing it in the package may not be applied at the right scope.
  3. Are you launching the script locally on the vm where it is running? If not, its possible the errors are in the log on the host.

@jreadytalk
Copy link
Author

Well, it seems to be working today 😝 I was searching the log for the words "exception" and "error". Maybe the exception message didn't contain those. It seems to log only the exception message and no stack trace, exception type, etc. So that may have been my confusion point.

Feel free to close this, and if I can repro an actual bug I'll post a zip of a repro case. Thanks!

Btw, setting $boxstarter.log seemed to work a treat except that it didn't persist between reboots. I had to set it at the top of every script I called from Install-BoxstarterPackage to try to make up for this, and some of the output in between may be getting lost at the old log location. I was launching from inside the VM.

@mwrock
Copy link
Member

mwrock commented Nov 27, 2014

Yup. Thats a duplicate of #18. Need to make the log file configurable.

@mwrock mwrock closed this as completed Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants