private static void Main(string[] args) { var serilogManager = UseGlobalSerilogLogger(); // Initialize log manager. LogManager.SetImplementation(serilogManager); //Do some DICOM work var file = DicomFile.Open(@"..\..\..\DICOM Media\Data\Patient1\2.dcm"); //Example of logging a dicom dataset //file.Dataset.WriteToLog(LogManager.Default.GetLogger("dumpedDataset"), LogLevel.Info); //Other logging using fo-dicom's log abstraction Dicom.Log.Logger foDicomLogger = LogManager.GetLogger("testLog"); foDicomLogger.Fatal("A fatal message at {dateTime}", DateTime.Now); foDicomLogger.Debug("A debug for file {filename} - info: {@metaInfo}", file.File.Name, file.FileMetaInfo); Console.WriteLine("Finished - hit enter to exit"); Console.ReadLine(); }
public PrintService(System.IO.Stream stream, Dicom.Log.Logger log) : base(stream, log) { var pi = stream.GetType() .GetProperty( "Socket", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); if (pi != null) { var endPoint = ((System.Net.Sockets.Socket)pi.GetValue(stream, null)).RemoteEndPoint as System.Net.IPEndPoint; RemoteIP = endPoint.Address; } else { RemoteIP = new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 }); } this.Logger = LogManager.GetLogger("Dicom.Printing"); }
public static void WriteToLog(this DicomFile file, Logger log, LogLevel level) { var logger = new DicomDatasetLogger(log, level); new DicomDatasetWalker(file.FileMetaInfo).Walk(logger); new DicomDatasetWalker(file.Dataset).Walk(logger); }
public static void WriteToLog(this IEnumerable<DicomItem> dataset, Logger log, LogLevel level) { var logger = new DicomDatasetLogger(log, level); new DicomDatasetWalker(dataset).Walk(logger); }
public ScpServiceInternal(FoDicomNetwork.INetworkStream stream, Encoding fallbackEncoding, FoDicomLog.Logger log) : base(stream, fallbackEncoding, log) { }
public DicomStorageProvider(INetworkStream stream, Encoding fallbackEncoding, Dicom.Log.Logger log) : base(stream, fallbackEncoding, log) { confManager = new ConfManager(ConfigurationManager.AppSettings["ConfigFilePath"]); configuration = confManager.GetConfiguration(); logger = NLog.LogManager.GetCurrentClassLogger(); }
public CStoreSCP(INetworkStream stream, Encoding fallbackEncoding, Dicom.Log.Logger log) : base(stream, fallbackEncoding, log) { }