From inside a Asp.Net Web Api Application (version 5) I am trying to send logs to LogEntries but cannot. With the same code and configuration, I can send the logs successfully from localhost.
This is the code I am using to send the logs (with NLog:)
private static Logger log = LogManager.GetCurrentClassLogger();
public static void LogString(string message)
{
log.Error(builder.ToString());
}
This is the web.config configuration:
<appSettings>
<add key="Logentries.Token" value="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" />
</appSettings>
<nlog>
<extensions>
<add assembly="LogentriesNLog" />
</extensions>
<targets>
<target name="logentries" type="Logentries" debug="true" httpPut="false" ssl="false" layout="${date:format=ddd MMM dd} ${time:format=HH:mm:ss} ${date:format=zzz yyyy} ${logger} : ${LEVEL}, ${message}" />
</targets>
<rules>
<logger name="*" minLevel="Debug" appendTo="logentries" />
</rules>
When I run this code on production as an Azure Web App, I do not see any logs on LogEntries console. When I run this on localhost, it runs successfully.
I also tried to make a simple http request with WebRequest class to google.com and could get 200 from the server on Azure. So I think that Azure app can access to Internet but cannot / does not access to LogEntries servers for some reason.
How can I diagnose this?