1
votes

I'm trying to use log4net to write to the Windows Event log. I'm using the Fellow Oak DICOM log4net connector

I have setup log4net as I would in any service: the XmlConfigurator in AssemblyInfo, the *exe.logger is Copy to output, Copy Always. I have the nuget package Dicom.Log4net and the log4net package installed.

After looking at the wiki, I've added

Dicom.Log.LogManager.SetImplementation(Dicom.Log.Log4NetManager.Instance);

Can I use my log4net xml config or would I need to initialize it like the Logging Serilog example?

1
I've found a work around and opened an issue on GitHub. The details of the workaround are in the issue. github.com/fo-dicom/fo-dicom/issues/244WhatWhat

1 Answers

0
votes

It turned out that the failure to identify the [XmlConfigurator] attribute in the AssemblyInfo.cs file was due to insufficient initialization of the underlying log4net LogManager, see issue #244 and pull request #248.

As of April 12, 2016, this issue has been corrected in the development branch of fo-dicom and will be incorporated in the next release.