LOG file for non command line app
Moderator: Moderator Team
LOG file for non command line app
We are using DcmSCU in our app.
How to setup a logfile to log all DCMTK errors ?
Thanks in advance
How to setup a logfile to log all DCMTK errors ?
Thanks in advance
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: LOG file for non command line app
Thanks for your reply Michael...
But logging which you pointed to provides logging
mechanism for command line dcmtk tools.
What if we use DCMTK APIs from within our app ?
How to use that script which resirest DCMTK error msgs output
to the file ?
Thanks again
Simon
But logging which you pointed to provides logging
mechanism for command line dcmtk tools.
What if we use DCMTK APIs from within our app ?
How to use that script which resirest DCMTK error msgs output
to the file ?
Thanks again
Simon
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: LOG file for non command line app
Hi,
I am not sure I understand you correctly. The howto I pointed you to shows how to configure the logging in DCMTK command line tools as well as DCMTK libraries. So every log output that is produced by DCMTK code can be controlled by the configuration measures demonstrated.
Or do you want to do something else?
Best,
Michael
I am not sure I understand you correctly. The howto I pointed you to shows how to configure the logging in DCMTK command line tools as well as DCMTK libraries. So every log output that is produced by DCMTK code can be controlled by the configuration measures demonstrated.
Or do you want to do something else?
Best,
Michael
Re: LOG file for non command line app
Michael...
Thanks again.
Maybe my explanation is poor...
config file for logging is placed on command line "...--log--config logfile.cfg...".
The question how to apply this config file (logfile.cfg) if it is not a command line tool ?
Thanks again
Simon
Thanks again.
Maybe my explanation is poor...
config file for logging is placed on command line "...--log--config logfile.cfg...".
The question how to apply this config file (logfile.cfg) if it is not a command line tool ?
Thanks again
Simon
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: LOG file for non command line app
Hi Simon,
ah, got it -- well, that's actually a good question
Our command line tools call oflog.cc's configureFromCommandLine(...) function, which extracts the logging configuration file (if provided on the command line) and then creates the related logging configuration via creating a dcmtk::log4cplus::helpers::Properties(log_file). The config is then is then applied via some further calls to the logging library.
You can create your own own dcmtk::log4cplus::helpers::Properties but I dont't see a way either to apply it from code if not using mentioned configureFromCommandLine() call. Maybe one of my DCMTK colleagues knows a way. If not, it may be worth adding a related call to the oflog.cc interface.
For now, you could (mis)use the configureFromCommandLine() call by creating fake parameters OFCommandline, OFConsoleApplication, and log level parameters. OFCommandline must then include the "--log-config" option with the file that you want to load.
Hope that helps,
Michael
ah, got it -- well, that's actually a good question
Our command line tools call oflog.cc's configureFromCommandLine(...) function, which extracts the logging configuration file (if provided on the command line) and then creates the related logging configuration via creating a dcmtk::log4cplus::helpers::Properties(log_file). The config is then is then applied via some further calls to the logging library.
You can create your own own dcmtk::log4cplus::helpers::Properties but I dont't see a way either to apply it from code if not using mentioned configureFromCommandLine() call. Maybe one of my DCMTK colleagues knows a way. If not, it may be worth adding a related call to the oflog.cc interface.
For now, you could (mis)use the configureFromCommandLine() call by creating fake parameters OFCommandline, OFConsoleApplication, and log level parameters. OFCommandline must then include the "--log-config" option with the file that you want to load.
Hope that helps,
Michael
Re: LOG file for non command line app
Michael...
Thanks again for all your quick replies.
Will try to implement your suggestions to fake ODCommandLine etc...
could you please make me a huge favor ans reply to my other post regarding
"PACS to PACS DICOM transfer" ?
Thanks
Simon
PS I owe you a lunch (at least). Come to Boston
Thanks again for all your quick replies.
Will try to implement your suggestions to fake ODCommandLine etc...
could you please make me a huge favor ans reply to my other post regarding
"PACS to PACS DICOM transfer" ?
Thanks
Simon
PS I owe you a lunch (at least). Come to Boston
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest