My friend Brad Younge posted an entry about logging under Sharepoint today. He managed to dig up a way to log directly to the Sharepoint log files found at  C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS.

All you need is this bit of magic:

Microsoft.Office.Server.Diagnostics.PortalLog.LogString

Read more at Brad’s blog