Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

How to setup seriLog.sinks.email with network credential

$
0
0

Hi, I'm trying to set up Serilog to send email + file logging. I use mailjet as my email server and I'm not able to set it up correctly with networkcredentials. Here is my config (with personnal data removed).

<add key="serverUrl" value="localhost"/>
<add key="serilog:using:Email" value="Serilog.Sinks.Email" />
<add key="serilog:write-to:Email.fromEmail" value="emailfrom"/>
<add key="serilog:write-to:Email.toEmail" value="emailto" />
<add key="serilog:write-to:Email.mailServer" value="in-v3.mailjet.com" />

<add key="serilog:enrich:with-property:environment" value="Localhost" />
<add key="serilog:write-to:Email.port" value="587"/>
<add key="serilog:write-to:Email.networkCredentials" value="'username':'username' 'password':'password'"/>

<add key="serilog:write-to:Email.EnableSsl" value="true"/>
<add key="serilog:write-to:Email.mailSubject" value="[{environment} - {MachineName}]" />
<add key="serilog:write-to:Email.outputTemplate" value="{Timestamp:yyyy-MM-dd  HH:mm:ss}:: [{SourceContext} {NewLine}{Level:u3} - {Message:lj}{NewLine}{Exception}{SourceContext}]" />
<add key="serilog:write-to:Email.restrictedToMinimumLevel" value="Error" />

I don,t knw what I'm doing wrong with this. If i use another smtp (Email.mailServer) that doesn't need credentials, it works, but i can't use this one in production.


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>