Skip to content

Logging with FhirStarter

verzada edited this page Jul 14, 2017 · 4 revisions

Log4Net

In DSTU2 we have tested Serilog, however after a while we realized Serilog has a way to go when it comes to configuration. We have returned to Log4Net since it is easier to setup through a configSection which can be referenced in the web.config.

Using Log4Net in your service or application

FhirStarter primarly logs OperationOutcomes which originates as Exceptions either from your service or in the framework itself. If you want to add more logging to your code, just include this line to create a Log4Net Log object

        private static readonly log4net.ILog Log =
            log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);