This question is an extended question to This post.
Since the nature of the question is different, I preferred to start a new thread.
When I use SMSS to login to sql server, I can see the sql server Logs under Management. ( I have 6 Files, archived included)
If I add a login trigger to the server to restrict users who can login to server, The log files are missing.
SQL Server Logs folder is empty.
If I delete the trigger, log out and log in again, the log files still are there and it also contains all the logs during the trigger too.
Why adding a login trigger hides the log files?
thank you.
This is the login trigger:
Since the nature of the question is different, I preferred to start a new thread.
When I use SMSS to login to sql server, I can see the sql server Logs under Management. ( I have 6 Files, archived included)
If I add a login trigger to the server to restrict users who can login to server, The log files are missing.
SQL Server Logs folder is empty.
If I delete the trigger, log out and log in again, the log files still are there and it also contains all the logs during the trigger too.
Why adding a login trigger hides the log files?
thank you.
This is the login trigger:
SQL:
CREATE OR ALTER TRIGGER LogonTrigger_For_Audit ON ALL SERVER FOR LOGON
AS
BEGIN
DECLARE @login NVARCHAR(200)
SET @login=ORIGINAL_LOGIN()
IF @login <> 'MyDomaninName\MyUserName'
BEGIN
INSERT INTO Master.dbo.tblLogonAudit (UserName, LogonTime,spid)
VALUES (@login, GETDATE(),@@SPID);
print @login + ' failed attempted login'
ROLLBACK
END
END