marrowyung
asked on
SQL server log to Windows event log
Dear all,
any way to drop the same SQL server log information to the Windows event log ?
any way to drop the same SQL server log information to the Windows event log ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"used this method in the past with stored procedures to update windows event logs with certain SQL log events which I would then capture using our monitoring software."
this is exactly what I want !
this is exactly what I want !
You should be able to do the same by studying the links I provided.
Thanks,
Raj
Thanks,
Raj
ASKER
how many time you implement this ?
ASKER
it might not good enought as this one don't WRITE to the event log anyway! my monitoring tools can only read event log and send related information for us!
I don't work with SQL on a day-to-day basis anymore, but the following code should write an informational event in the Application event logs with event id 17061.
USE master;
EXEC xp_logevent 60000, 'Hello World', informational
Combine this with the first link which will show you how to enumerate the SQL logs from T-SQL and you will have what you want. I am afraid I don't have the resources to do this work for you.
Thanks,
Raj
USE master;
EXEC xp_logevent 60000, 'Hello World', informational
Combine this with the first link which will show you how to enumerate the SQL logs from T-SQL and you will have what you want. I am afraid I don't have the resources to do this work for you.
Thanks,
Raj
ASKER
" I am afraid I don't have the resources to do this work for you.
No need, but I read the link, it is about import the application event log to the SQL server temp table !
not from MS SQL server log to application log.
No need, but I read the link, it is about import the application event log to the SQL server temp table !
not from MS SQL server log to application log.
ASKER
"USE master;
EXEC xp_logevent 60000, 'Hello World', informational
"
this also means that only any error with "Hello world" only message will be logged, right?
EXEC xp_logevent 60000, 'Hello World', informational
"
this also means that only any error with "Hello world" only message will be logged, right?
ASKER
and we can only execute one type of this one?
can we do :
1)USE master;
EXEC xp_logevent 60000, 'Hello World', informational
2) USE master;
EXEC xp_logevent 60000, 'error", informational
3) USE master;
EXEC xp_logevent 60000, "alert", informational
the result is the effect of aLL of them?
can we do :
1)USE master;
EXEC xp_logevent 60000, 'Hello World', informational
2) USE master;
EXEC xp_logevent 60000, 'error", informational
3) USE master;
EXEC xp_logevent 60000, "alert", informational
the result is the effect of aLL of them?
ASKER