|
From: Daniel M. <dan...@be...> - 2006-02-10 14:08:59
|
Leif,=20 I found a person with a similar flushing problem on usenet when fprintf is invoked under a JVM: http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread /1c4b786fe609c2ff/d30d06cccda7e21c?lnk=3Dst&q=3Dfprintf+java+flush&rnum=3D= 3&hl =3Den#d30d06cccda7e21c Looks promising. Might just have to force the flush (with fflush? I haven't programmed C in for quite some time). If I have time, I might try and force the flush and compile it myself to test it. From my quick look at logger.c, it seems like the fprintf call of interest is at logger.c:729 when running in console mode. Sound reasonable? Do you know of any drawbacks to flushing after every write? Daniel Mace Software Engineer, Payroll Integration benefitfocus.com 843-849-7476 x393 =20 > -----Original Message----- > From: wra...@li...=20 > [mailto:wra...@li...] On Behalf=20 > Of Daniel Mace > Sent: Friday, February 10, 2006 8:50 AM > To: wra...@li... > Subject: RE: [Wrapper-user] Wrapper stdout redirection in realtime >=20 > Leif, >=20 > > Strange. I assume you are using the console output of the=20 > Wrapper. =20 > > That output should > > be getting sent to stdout in pretty much real time. It shows up in=20 > > the console immediately > > on all platforms at least. I wonder if there is some kind=20 > > of a flush > > that needs to be done > > that is not needed the way the wrapper is normally used. You might=20 > > want to try poking > > around in the logger.c file to see if you have any ideas. =20 > > The Windows > > version makes > > use of the WriteConsole function to write to the console if=20 > running as=20 > > a service and a console is being displayed. Other cases=20 > simply write=20 > > to stdout. >=20 > I will take a peek at it today to see if I notice anything obvious... >=20 > > I'll poke around, but other than flushing ??? Not sure=20 > what it would=20 > > be. Let me know how your program is running. If you are=20 > running as a=20 > > service, then you may need to set the wrapper.ntservice.console=20 > > property to get a console to capture from. >=20 > I apologize! I should have mentioned in my first message: I=20 > am running in console mode, NOT as a service. Hopefully this=20 > will be a clue.=20 >=20 > Thanks for the tips. The search continues... >=20 > Daniel Mace > Software Engineer, Payroll Integration > benefitfocus.com > 843-849-7476 x393 >=20 >=20 > > -----Original Message----- > > From: wra...@li... > > [mailto:wra...@li...] On Behalf Of Leif=20 > > Mortenson > > Sent: Thursday, February 09, 2006 10:33 PM > > To: wra...@li... > > Subject: Re: [Wrapper-user] Wrapper stdout redirection in realtime > >=20 > > Daniel, > >=20 > > Daniel Mace wrote: > > > I have a C#/.NET 2.0 GUI application I use as a front end=20 > to a Java=20 > > > application I have developed. Traditionally, this Java app > > was invoked > > > via a DOS batch script which constructed classpaths and > > executed the > > > Java command directly. Within the GUI application, I was able to=20 > > > invoke the batch script and redirect stdout and stderr to > > capture the > > > Java app's output in realtime and display it to the user.=20 > > In order to > > > gain more control over the indirectly-invoked Java app, I have=20 > > > encapsulated it in the Service Wrapper, to good effect (For > > instance, > > > I can now capture the pid of the Java/wrapper instance=20 > and kill it=20 > > > from the C# application). I realize this isn't necessarily > > the intent > > > of the wrapper, but launch4j can't do all the classpath > > stuff I need, > > > and I don't have access to an exe4j license. So bear with me... > > > =20 > > Fine. viva open source. :-) > > > My problem is this: since I modified the batch script to=20 > invoke the=20 > > > wrapper rather than the Java command itself to launch the > > application, > > > my C# application no longer gets realtime output from=20 > stdout/stderr=20 > > > when the wrapper is running. The C# code itself hasn't=20 > changed; in=20 > > > fact, output from the batch script itself gets redirected > > properly and > > > in realtime as before. It's just the wrapper output which > > is funky: it > > > doesn't actually get passed back to stdout until it's > > completely run > > > its course. > > > =20 > > Strange. I assume you are using the console output of the=20 > Wrapper. =20 > > That output should > > be getting sent to stdout in pretty much real time. It shows up in=20 > > the console immediately > > on all platforms at least. I wonder if there is some kind=20 > > of a flush > > that needs to be done > > that is not needed the way the wrapper is normally used. You might=20 > > want to try poking > > around in the logger.c file to see if you have any ideas. =20 > > The Windows > > version makes > > use of the WriteConsole function to write to the console if=20 > running as=20 > > a service and a console is being displayed. Other cases=20 > simply write=20 > > to stdout. > > > Any ideas what could be causing this? Obviously it's redirecting=20 > > > somewhat properly, because I do eventually get the stdout=20 > stream... > > > but not until the end of the wrapper execution. I searched and=20 > > > couldn't find any configuration properties related to > > output redirection. > > > =20 > > I'll poke around, but other than flushing ??? Not sure=20 > what it would=20 > > be. Let me know how your program is running. If you are=20 > running as a=20 > > service, then you may need to set the wrapper.ntservice.console=20 > > property to get a console to capture from. > >=20 > > Cheers, > > Leif > > > Heeeelllp! :) > > > > > > Daniel Mace > > > Software Engineer, Payroll Integration benefitfocus.com > > > 843-849-7476 x393 > > > > > > > > >=20 > > ************************************************************** > > ************************** > > > BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic > > message is intended only for the individual or entity to=20 > which it is=20 > > addressed and may contain information that is confidential and=20 > > protected by law. Unauthorized review, use, disclosure, or=20 > > dissemination of this communication or its contents in any way is=20 > > prohibited and may be unlawful. If you are not the intended=20 > recipient=20 > > or a person responsible for delivering this message to an intended=20 > > recipient, please notify the original sender immediately by=20 > e-mail or=20 > > telephone, return the original message to the original sender or to=20 > > bfp...@be..., and destroy all copies or=20 > derivations=20 > > of the original message. Thank you. > > (BFeComNote Rev. 08/01/2005) > > >=20 > > ************************************************************** > > ************************* > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do you grep > > through log files > > > for problems? Stop! Download the new AJAX search engine=20 > that makes=20 > > > searching your log files as easy as surfing the web. > > DOWNLOAD SPLUNK! > > > = http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=103432&bid#0486&dat=121642 > > > _______________________________________________ > > > Wrapper-user mailing list > > > Wra...@li... > > > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > > > > =20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log=20 > > files for problems? Stop! Download the new AJAX search=20 > engine that=20 > > makes searching your log files as easy as surfing the web. > > DOWNLOAD SPLUNK! > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > > _______________________________________________ > > Wrapper-user mailing list > > Wra...@li... > > https://lists.sourceforge.net/lists/listinfo/wrapper-user > >=20 >=20 >=20 > ************************************************************** > ************************** > BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic=20 > message is intended only for the individual or entity to=20 > which it is addressed and may contain information that is=20 > confidential and protected by law. Unauthorized review, use,=20 > disclosure, or dissemination of this communication or its=20 > contents in any way is prohibited and may be unlawful. If you=20 > are not the intended recipient or a person responsible for=20 > delivering this message to an intended recipient, please=20 > notify the original sender immediately by e-mail or=20 > telephone, return the original message to the original sender=20 > or to bfp...@be..., and destroy all copies=20 > or derivations of the original message. Thank you. =20 > (BFeComNote Rev. 08/01/2005) > ************************************************************** > ************************* >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files for problems? Stop! Download the new AJAX=20 > search engine that makes searching your log files as easy as=20 > surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=103432&bid#0486&dat=121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user >=20 *************************************************************************= *************** BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is = intended only for the individual or entity to which it is addressed and = may contain information that is confidential and protected by law. = Unauthorized review, use, disclosure, or dissemination of this = communication or its contents in any way is prohibited and may be = unlawful. If you are not the intended recipient or a person responsible = for delivering this message to an intended recipient, please notify the = original sender immediately by e-mail or telephone, return the original = message to the original sender or to bfp...@be..., and = destroy all copies or derivations of the original message. Thank you. = (BFeComNote Rev. 08/01/2005) *************************************************************************= ************** |