Ans. In SharePoint Foundation, ULS exposes configurable settings in two ways, through the - Object model and Windows PowerShell cmdlets. For writing to SharePoint ULS logs developers can can use Diagnostics Service, which will make the customized categories viewable in the administrative UI for our errors.
or they can use the number of cmdlets available for accessing ULS logs using powershell. Some of the cmdlets are Get-SPDiagnosticConfig ,Get-SPLogEvent etc.
See examples @ Writing errors to ULS logs and event logs Sharepoint 2010