Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am running the storescp as a windows service using NSSM. How can I log the status of the service started and stopped in a log file.

What I have tried:

Haven't tried the code. An Idea to approach the scenario is ok.Thanks in advance.
Posted
Updated 21-Jan-20 20:51pm
Comments
Richard MacCutchan 21-Jan-20 4:28am    
Most likely by adding some code to the start and stop methods of the service.
Member 14618087 21-Jan-20 4:48am    
There is no stop and start method in nssm. Is it possible to code in the storescp code of dcmtk.
Richard MacCutchan 21-Jan-20 4:56am    
No idea, what does the documentation say?
Member 14618087 21-Jan-20 5:02am    
It doesnt mention regarding this in the documentation.I Can able to find the start and abort in the storescp but not the stop in the storescp listener.I need to know when the listener is stopped need to log an entry of it.
Richard MacCutchan 21-Jan-20 5:45am    
Sorry, I have never used this product and, to be honest, it looks like a hack.

1 solution

Pipe the console output of Dcmtk storescp to your own executable that parses the words that say start and stop. I do not know the exact wording. But I had done it before. But you cannot run it as a windows service this way.

A way to detect the listener is still alive is to have it echo your words and detect it.

OP should have put in more effort in reading documentation since he is coding a medical application.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900