Provides a diagnostic logging category manager for Windows SharePoint Services.
Contains the EventSeverity and TraceSeverity properties for a specific category.
How to use ULS in SharePoint 2010 for Custom Code Exception Logging?
Writing errors to ULS logs and event logs Sharepoint 2010
Here is a sample script for writing your custom entries into ULS log. In WSS 3.0 it was little difficult as there was no any direct APIs to do it like in MOSS. But in 2010 version, SharePoint Foundation (WSS 4.0) also has this facility.
How to write custom logs into ULS logs – SharePoint Foundation 2010 ( WSS 4.0) ?