Support for Logary
Supporting all of the major logging and error management solutions for .NET is a high priority on elmah.io. Whether you use ELMAH or simple logging solutions like log4net and Serilog, you should get a great experience combining them with elmah.io. As the first online error management system out there, we recently released support for the up-and-coming logging library Logary. Logary is primarily written in F#, but supports all of the languages available on the .NET platform.
To start logging to elmah.io from Logary, install the Logary.Targets.Elmah.Io package. Be aware that there's a Logary.Targets.ElmahIO package as well. That's for the old version of Logary. Then add some code:
using (var logary = LogaryFactory.New("Logary.CSharpExample", with => with
.Target<Targets.ElmahIO.Builder>(
"elmah.io",
conf => conf.Target.WithLogId(Guid.Parse("LOG_ID")))).Result)
{
var logger = logary.GetLogger("Logary.CSharpExample");
try
{
throw new ApplicationException("thing went haywire");
}
catch (Exception e)
{
logger.LogEventFormat(LogLevel.Fatal, "Unhandled {exception}!", e);
}
}
The example is written in C# since we know that most of you are C# programmers. To see a similar example in F#, check out our Logary documentation as well as the F# and C# examples in the Logary source code.
Try Logary today; get started by doing Install-Package Logary.Targets.Elmah.Io
.