NLog different files target for each SCU

已查看 58 次
跳至第一个未读帖子

Adil Tiadi

未读,
2017年12月21日 13:46:142017/12/21
收件人 Fellow Oak DICOM
Hi,

I tried in StoreSCP sample to add NlogManager.

It worked for one file with all communications of every SCUs.

But I need to have differents files for each SCU connected.
 
Someone have a clue to help me?

Thanks.

Adil

reini....@aon.at

未读,
2017年12月21日 16:40:292017/12/21
收件人 Fellow Oak DICOM
have not tried, but an idea: NLogManager has a method GetLogger(string name). As I understand, you can have several Logger instances with different names resulting in different files.
Then you can try the following. define a class field of type Logger in the class StoreSCP (the class deriving from DicomService). In the method
OnReceiveAssociationRequest(DicomAssociation association)
you could then initialize this field with _logger = nLogManager.GetLogger(association.CallingAE). by that you have a Logger instance for every calling AETitle.

Does this idea help/work?

Adil Tiadi

未读,
2017年12月22日 04:49:352017/12/22
收件人 Fellow Oak DICOM
Hi,

Thanks a lot!
But it write the same thing on each file for each CallingAE!
Target name and file are different on my code.
Can you show me a sample code?
(I take a log on sample provided in dfo-dicom NlogTest...and no success)

See you soon,


 
回复全部
回复作者
转发
0 个新帖子