2016-11-28

Google Logging from log4net

Google Stackdriver was made generally available a month ago. It's Logging component allows for custom application logs to be written to it. You may send your customer .NET logs there too. After you send your logs, just open up https://console.cloud.google.com/logs/ and select Custom Logs to view.


log4net

log4net is a well established logging package with 6+ million downloads on NuGet. The Google.Logging.Log4Net is currently in prerelease and has an appender for log4net.



Here is how to get started using it in F#. I prefer code config instead of xml config.

Loading gist ...

When you run it, if you haven't set up your App Default Creds, you may get an error like this:


You simply need to login and may be read my last blog post related to the topic. You can log by running gcloud auth application-default login like so:


Other Loggers

I would like to see support for Google Logging added to other .NET loggers like NLog and Logary, so I made the feature requests. Neither should be terribly hard if you are looking to contribute.