Basically, what you have listed before is a good start to the code.
function GeneralEvents_OnLogError(Sender, LogParams)
{
TestComment = LogParams.AdditonalText
}
This assigns the value of "AdditionalText" to a variable called "TestComment". so, your next step would be to take "TestComment" and pass it in to some sort of function or value that you would then write out to a file or to SQL.
I guess the question I have for you is this:
What is your ultimate aim? Do you want to only write out the information for errors? do you want the whole log file output? You mentioned writing to SQL. Is that your preferred destination? For what purpose are you doing this output? We'd be happy to help but we need to know a bit more of what your desire is here.