locked
Add-In Logging RRS feed

  • Question

  • What kind of logging is recommended for the Add-In development?

    Regards,
    mschnecke
    Tuesday, October 7, 2008 8:38 AM

Answers

  • The WHS console has built-in tracing to C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\logs\, into  the HomeServerConsole.<datetime>.log file.

    You can log into the same file using Support.TrError("Some error") or Support.TrStatus("Some status message"). Your message will end up datestamped in the above log file. You'll need to add "using Microsoft.WindowsServerSolutions.Common;" to your code to use this functionality.

    This is the same place that console crashes caused by add-ins are logged, so it's a good place to log things in my opinion. WHS creates a new file every time you open the console, so unless you're logging crazy amounts of data you won't blow-out the log file.
    Wednesday, October 8, 2008 7:51 AM
    Moderator

All replies

  • What kind of logging does your add-in need? You can log what you need to, if you have requirements beyond standard event log entries.
    I'm not on the WHS team, I just post a lot. :)
    Tuesday, October 7, 2008 4:36 PM
    Moderator
  • I want to trace the add-in functionallity to support the customer in error cases. Is a logfile recommended, and where I have to save the file? Or should I use the Eventlog? Is there an existing WHS add-in logging mechanisms or recommendation?

    Regards,
    mschnecke

    Wednesday, October 8, 2008 7:23 AM
  • The WHS console has built-in tracing to C:\Documents and Settings\All Users\Application Data\Microsoft\Windows Home Server\logs\, into  the HomeServerConsole.<datetime>.log file.

    You can log into the same file using Support.TrError("Some error") or Support.TrStatus("Some status message"). Your message will end up datestamped in the above log file. You'll need to add "using Microsoft.WindowsServerSolutions.Common;" to your code to use this functionality.

    This is the same place that console crashes caused by add-ins are logged, so it's a good place to log things in my opinion. WHS creates a new file every time you open the console, so unless you're logging crazy amounts of data you won't blow-out the log file.
    Wednesday, October 8, 2008 7:51 AM
    Moderator
  •  Ken, Sam, thank you for your replies. I will use the build-in logging mech.
    Thursday, October 9, 2008 7:35 AM
  • Congratulations on being selected as an MVP btw, Sam. Could you drop me an email off-line? My email address should be extractable from my profile.
    I'm not on the WHS team, I just post a lot. :)
    Thursday, October 9, 2008 10:27 PM
    Moderator
  • Thanks Ken. Email sent.
    Thursday, October 9, 2008 11:14 PM
    Moderator