You wouldn’t use triggers to log errors into the SQL Server. You would need to put code into the stored procedures that make up your application to log any errors which are encountered.
Register Hereor login if you are already a member
Some statement which fails.
INSERT INTO LogTable
(ErrorMessage, ErrorNumber, ...)
SELECT ERROR_MESSAGE(), ERROR_NUMBER(), ...
IF @@TRANCOUNT <> 0