I just started trying to implement ULS logging since it looks like there are some great APIs on 2010.. but for some reason when I execute this code below on the web app it does not write anything - I'm a little confused as to why nothing's getting logged!
anyone else have this issue?
SPDiagnosticsService diagSvc = SPDiagnosticsService.Local; // so far so good...
diagSvc.WriteTrace( 0, new SPDiagnosticsCategory("Hello ULS", TraceSeverity.Monitorable, EventSeverity.Error), TraceSeverity.Monitorable, "Writing to the ULS logs ain't happening.", null );
// the line above does not throw any error - it just just executes without ever writing anything!! same line is placed in a console app, and it works like a charm.
Note that I am writing this inside say a web part or other typical code areas where you'd want to log activity in a custom SP solution... the same exact code works like a charm on a console app, which makes me wonder why not on the solution code?.. any
View Complete Post