You can find a sample solution called Custom Database Trace Listener Sample at Enterprise Library Sample Projects.
The basic steps are to create a custom LogEntry class with a custom property. An additional column is added to the [Log] table and the out of the box stored procedure is modified to accept a new parameter. Then a custom Trace Listener passes the custom property data to the stored procedure where it is inserted into the database.