Feature request: logging

Would it be possible to get wybuild and wyupdate/updater control to log (log4net is a good option) useful error / progress messages to console/file. Ideally, the logging mechanism is configurable (desitination, verbosity, etc) so it makes sense in the context of the rest of the application.

I have an issue where the automatic updater control seems to hang on checking for updates.... There's no log, so was nothing to go on to troubleshoot (Process monitor helped me figure it out, but that's not available to diagnose a customer side issue).

Additionally, I just came across an issue in my automated build script where wybuild didn't report anything other than an application exit code of 1.

For the wybuild case, this is the commandline I used:

"C:\Program Files\wyBuild\wybuild.exe" C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp /bu /bwu -add="C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\currentversionmanifest.xml"

The issue turned out to be that C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp does not exist.

"C:\Program Files\wyBuild\wybuild.exe" C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp /bu /bwu -add="C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\currentversionmanifest.xml"

The issue turned out to be that C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp does not exist.

wyBuild actually tells you where the error occurs. Here's what was output in the console when I ran the same command on my computer:

The update failed to build: Could not find file 'C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp'.

To log wyBuild commandline failures, simply pipe the console output to a file.

Similarly, wyUpdate actually shows failures to the end user. So they can copy and paste any errors and send them directly to you. If the errors are a result of a bug on our part, then you can send the errors to us and we'll fix them.

Regarding logging the AutomaticUpdater, we think this will add more problems than it's worth (the AutomaticUpdater uses heavy threading and IPC - writing to files from multiple threads and processes introduces several new problems). However, since the AutomaticUpdater throws exceptions you can simply log them yourself.

I have an issue where the automatic updater control seems to hang on checking for updates.... There's no log, so was nothing to go on to troubleshoot (Process monitor helped me figure it out, but that's not available to diagnose a customer side issue).

Can you tell me what the problem was so we can handle it better?

wyBuild actually tells you where the error occurs. Here's what was output in the console when I ran the same command on my computer:

The update failed to build: Could not find file 'C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp'.

To log wyBuild commandline failures, simply pipe the console output to a file.

Interesting - I wasn't getting anything on the console both manually and via the output from our build system (teamcity + msbuild), which captures the console.

[18:50:09]: [Project "buildMSI.msbuild.teamcity.patch.tcprojx" (UntestedBuild target(s)):] "C:\Program Files\wyBuild\wybuild.exe" C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp /bu /bwu -add="C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\currentversionmanifest.xml" [18:50:13]: [Project "buildMSI.msbuild.teamcity.patch.tcprojx" (UntestedBuild target(s)):] C:\BuildAgent\work\41ba8ced08eeaae3\Build\buildMSI.msbuild(191, 5): error MSB3073: The command ""C:\Program Files\wyBuild\wybuild.exe" C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\gojilog.wyp /bu /bwu -add="C:\BuildAgent\work\41ba8ced08eeaae3\Update\Temp\currentversionmanifest.xml" " exited with code 1.[18:50:13]: Process exited with code 1

Attempting it again, I do get an error on the console (haven't tried the build) - intermittent? Perhaps the build system stops console output capture after getting an exit code, and combined with the output lag behaviour wybuild exhibits. I'll try to work round it with output redirection.

Similarly, wyUpdate actually shows failures to the end user. So they can copy and paste any errors and send them directly to you. If the errors are a result of a bug on our part, then you can send the errors to us and we'll fix them.

Regarding logging the AutomaticUpdater, we think this will add more problems than it's worth (the AutomaticUpdater uses heavy threading and IPC - writing to files from multiple threads and processes introduces several new problems). However, since the AutomaticUpdater throws exceptions you can simply log them yourself.

With a logging framework like log4net, you can control the locking. Our app is heavily threaded too and playing with the locking does the trick.Here's a snippet from our log4net config file. <appender name="GojiLog" type="log4net.Appender.RollingFileAppender"> <file value="${TEMP}\Tests\test.log" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />... </appender>

I can see you point re. IPC - for that I'd recommend logging to a file per process.

I have an issue where the automatic updater control seems to hang on checking for updates.... There's no log, so was nothing to go on to troubleshoot (Process monitor helped me figure it out, but that's not available to diagnose a customer side issue).

Can you tell me what the problem was so we can handle it better?[/quote]

See https://wyday.com/forum/t/363/cannot-update-application-after-declining-uac-closing-app/