문제

Hi I have a database trace listener and I would like to log the stack trace on the database when I get an error. I can add the stack trace to the message pretty easily but I would prefer to add it to another column in the database table. How would I achieve this?

도움이 되었습니까?

해결책

You can find a sample solution called Custom Database Trace Listener Sample at Enterprise Library Sample Projects.

The basic steps are to create a custom LogEntry class with a custom property. An additional column is added to the [Log] table and the out of the box stored procedure is modified to accept a new parameter. Then a custom Trace Listener passes the custom property data to the stored procedure where it is inserted into the database.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top