【问题标题】:Serilog.Sink.LogEntries doesn't work when run on mono on UbuntuSerilog.Sink.LogEntries 在 Ubuntu 上以单声道运行时不起作用
【发布时间】:2016-05-07 17:38:49
【问题描述】:

我想将 Serilog 与 LogEntries 一起使用。当我在 Windows PC 上运行该应用程序时,这工作正常,但是在 ubuntu 14.2 上构建和运行单声道时,在 LogEntries 上没有收到任何消息。 作为第二个 slog sink,我已经配置了控制台输出,这适用于 Linux。

在 serilog 中打开 selfdebug 后,我记录了这个异常:

2016-05-05T10:55:00 Exception while emitting periodic batch from Serilog.Sinks.Logentries.LogentriesSink: System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (IAsyncResult asyncResult) [0x00040] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (IAsyncResult ar, Boolean ignoreEmpty) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (IAsyncResult result) [0x00071] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x0003b] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x0000c] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (IAsyncResult asyncResult) [0x00057] in <filename unknown>:0 
  at System.Net.Security.SslStream.EndAuthenticateAsClient (IAsyncResult asyncResult) [0x00011] in <filename unknown>:0 
  at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) [0x0000e] in <filename unknown>:0 
  at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost) [0x00007] in <filename unknown>:0 
  at Serilog.Sinks.Logentries.LeClient.Connect () [0x00049] in <filename unknown>:0 
  at Serilog.Sinks.Logentries.LogentriesSink.EmitBatch (IEnumerable`1 events) [0x00023] in <filename unknown>:0 
  at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick () [0x00051] in <filename unknown>:0 
2016-05-05T10:55:02 Exception while emitting periodic batch from Serilog.Sinks.Logentries.LogentriesSink: System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (IAsyncResult asyncResult) [0x00040] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (IAsyncResult ar, Boolean ignoreEmpty) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (IAsyncResult result) [0x00071] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x0003b] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x0000c] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (IAsyncResult asyncResult) [0x00057] in <filename unknown>:0 
  at System.Net.Security.SslStream.EndAuthenticateAsClient (IAsyncResult asyncResult) [0x00011] in <filename unknown>:0 
  at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) [0x0000e] in <filename unknown>:0 
  at System.Net.Security.SslStream.AuthenticateAsClient (System.String targetHost) [0x00007] in <filename unknown>:0 
  at Serilog.Sinks.Logentries.LeClient.Connect () [0x00049] in <filename unknown>:0 
  at Serilog.Sinks.Logentries.LogentriesSink.EmitBatch (IEnumerable`1 events) [0x00023] in <filename unknown>:0 
  at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick () [0x00051] in <filename unknown>:0 
2016-05-05T10:55:13 Exception while emitting periodic batch from Serilog.Sinks.Logentries.LogentriesSink: System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (IAsyncResult asyncResult) [0x00040] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (IAsyncResult ar, Boolean ignoreEmpty) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (IAsyncResult result) [0x00071] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x0003b] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x0000c] in <filename Thread started: <Thread Pool> #9
unknown>:0 

看起来 Mono 和 Logentries 之间存在 SSL 问题。

【问题讨论】:

标签: mono serilog logentries


【解决方案1】:

使用Linux Agent 跟踪创建的日志文件可能更容易。然后,代理会将此日志数据转发到您的帐户。

【讨论】:

  • 非常感谢,这是一个非常有用的提示,尤其是因为它还记录系统数据
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-06
  • 2017-07-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多