SQL Trigger Question
The whole code of your trigger is weird. Why checking if SELECT COUNT(*) FROM INSERTED?, I mean, if the trigger is running is because you inserted some row on the table. Then, you are trying to assign posibly multiple values on a variable, and joining with a CTE when it really doesn't seem necessary. 

The code seems that it can be replaced with just:

CREATE TRIGGER [dbo].[SENDTXT_MSG] ON [dbo].[db_log] after 
INSERT AS 
BEGIN 

INSERT INTO test(test)
SELECT object_name
FROM INSERTED
WHERE msg_type = 'error';


END