SharePoint 2010 - How to write custom logs into ULS logs

Here is a sample script for writing your custom entries into ULS log.

https://blogs.msdn.com/sowmyancs/archive/2010/04/17/how-to-write-custom-logs-into-uls-logs.aspx