我可以获取更长的事件查看器消息吗?

时间:2018-10-30 15:33:00

标签: .net windows-services windows-server-2016 event-viewer

我们的服务中的某些东西不断使服务器崩溃,尽管并非总是如此,但这当然仍然不是一件好事。由于服务崩溃,因此无法将有关崩溃的任何信息记录到我们的数据库中,但是Windows中的事件查看器在某种程度上做到了这一点。问题在于,在显示任何特定于服务的代码之前,该消息已被切断,例如:

Failed to stop service. System.InvalidOperationException: An unhandled exception was detected --->
System.Data.Entity.Core.EntityException: The underlying provider failed on Open. --->
System.InvalidOperationException: The connection was not closed. The connection's current state is connecting.
    at System.Data.ProviderBase.DbConnectionClosedConnecting.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.Open()
    at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
    at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext intercepti...

如您所见,结尾处只有一个“ ...”,这意味着我看不到此错误在哪里发生。无论如何,要确保消息更长吗?它是在Windows Server 2016上作为服务运行的.NET应用程序。

我必须承认我不确定这是否是正确的论坛,但是我现在没有主意,也无法在Google上找到任何答案。

0 个答案:

没有答案
相关问题