I installed StoreScp as Service via srvany. But I didn't get the stdout redirected to a file. I tried a lot of different things but somehow srvany removes my > commands. Is it possible to have a commandline switch that redirect stdout or stderr to a file?
Or does anybody a working AppParameters registry entry for srvany which do the job?
Freudi
stdout
Moderator: Moderator Team
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
If you would like to test the current snapshot of the DCMTK, there is another solution (based on the new unified logging mechanism -- see Howto: Output all log messages to a file).
stdout
Wow ! At first I want to pay a compliment. I downloaded snapshot, cmake and after 10 minutes I have a functioning storescp. Great. BTW I use VS2008.
Now I can use the new commandline switch that you suggest. And it is working, buuut because it is service I want all stdout messages in that file. In the case that a directory don't exist or don't exists anymore, these messages still go out to the DOS-Window not to the file. Example:
storescp had command line switch -od "C:\tmp"
If start it as a service and c:\tmp didn't exist I got no msg in the logfile.
The results of commandline parsing should go to the logfile, too.
Now I have the sources . Do you have any hint where and how to include that?
Freudi
Now I can use the new commandline switch that you suggest. And it is working, buuut because it is service I want all stdout messages in that file. In the case that a directory don't exist or don't exists anymore, these messages still go out to the DOS-Window not to the file. Example:
storescp had command line switch -od "C:\tmp"
If start it as a service and c:\tmp didn't exist I got no msg in the logfile.
The results of commandline parsing should go to the logfile, too.
Now I have the sources . Do you have any hint where and how to include that?
Freudi
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Something like the following should work:
Regarding the use of the logger output for command line tools see the following Wiki page.
Code: Select all
diff -r1.122 storescp.cc
1006c1006,1009
< app.printError("specified output directory does not exist");
---
> {
> OFLOG_FATAL(storescpLogger, "specified output directory does not exist");
> return 1;
> }
1011c1014,1017
< app.printError("specified output directory is not writeable");
---
> {
> OFLOG_FATAL(storescpLogger, "specified output directory is not writeable");
> return 1;
> }
Who is online
Users browsing this forum: Bing [Bot] and 1 guest