|
From: Daniel M. <dan...@be...> - 2006-02-10 13:47:52
|
Leif, > Strange. I assume you are using the console output of the Wrapper. =20 > That output should > be getting sent to stdout in pretty much real time. It shows=20 > up in the console immediately > on all platforms at least. I wonder if there is some kind=20 > of a flush=20 > that needs to be done > that is not needed the way the wrapper is normally used. You=20 > might want to try poking > around in the logger.c file to see if you have any ideas. =20 > The Windows=20 > version makes > use of the WriteConsole function to write to the console if=20 > running as a service and a console is being displayed. Other=20 > cases simply write to stdout. I will take a peek at it today to see if I notice anything obvious... > I'll poke around, but other than flushing ??? Not sure what=20 > it would be. Let me know how your program is running. If=20 > you are running as a service, then you may need to set the=20 > wrapper.ntservice.console property to get a console to capture from. I apologize! I should have mentioned in my first message: I am running in console mode, NOT as a service. Hopefully this will be a clue.=20 Thanks for the tips. The search continues... Daniel Mace Software Engineer, Payroll Integration benefitfocus.com 843-849-7476 x393 > -----Original Message----- > From: wra...@li...=20 > [mailto:wra...@li...] On Behalf=20 > Of Leif 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 to a Java=20 > > application I have developed. Traditionally, this Java app=20 > was invoked=20 > > via a DOS batch script which constructed classpaths and=20 > executed the=20 > > Java command directly. Within the GUI application, I was able to=20 > > invoke the batch script and redirect stdout and stderr to=20 > capture the=20 > > Java app's output in realtime and display it to the user.=20 > In order to=20 > > gain more control over the indirectly-invoked Java app, I have=20 > > encapsulated it in the Service Wrapper, to good effect (For=20 > instance,=20 > > I can now capture the pid of the Java/wrapper instance and kill it=20 > > from the C# application). I realize this isn't necessarily=20 > the intent=20 > > of the wrapper, but launch4j can't do all the classpath=20 > stuff I need,=20 > > 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 invoke the=20 > > wrapper rather than the Java command itself to launch the=20 > application,=20 > > my C# application no longer gets realtime output from stdout/stderr=20 > > when the wrapper is running. The C# code itself hasn't changed; in=20 > > fact, output from the batch script itself gets redirected=20 > properly and=20 > > in realtime as before. It's just the wrapper output which=20 > is funky: it=20 > > doesn't actually get passed back to stdout until it's=20 > completely run=20 > > its course. > > =20 > Strange. I assume you are using the console output of the Wrapper. =20 > That output should > be getting sent to stdout in pretty much real time. It shows=20 > up in the console immediately > on all platforms at least. I wonder if there is some kind=20 > of a flush=20 > that needs to be done > that is not needed the way the wrapper is normally used. You=20 > might want to try poking > around in the logger.c file to see if you have any ideas. =20 > The Windows=20 > version makes > use of the WriteConsole function to write to the console if=20 > running as a service and a console is being displayed. Other=20 > cases simply write to stdout. > > Any ideas what could be causing this? Obviously it's redirecting=20 > > somewhat properly, because I do eventually get the stdout stream...=20 > > but not until the end of the wrapper execution. I searched and=20 > > couldn't find any configuration properties related to=20 > output redirection. > > =20 > I'll poke around, but other than flushing ??? Not sure what=20 > it would be. Let me know how your program is running. If=20 > you are running as a service, then you may need to set the=20 > wrapper.ntservice.console 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=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 > ************************************************************** > ************************* > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. =20 > 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 files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. =20 > 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 *************************************************************************= *************** 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) *************************************************************************= ************** |
|
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) *************************************************************************= ************** |
|
From: Daniel M. <dan...@be...> - 2006-02-10 14:51:15
|
Leif, IT WORKS! Awesome. :) Will this feature/workaround be going into the next release? I'll be using this snapshot in the meantime.=20 It's been a pleasure working on this with you. Many thanks. If there are any more specific details you need from me regarding this problem, I'd be glad to help. Thanks again. 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 Leif Mortenson > Sent: Friday, February 10, 2006 9:43 AM > To: wra...@li... > Subject: Re: [Wrapper-user] Wrapper stdout redirection in realtime >=20 > That link should have been: > http://wrapper.tanukisoftware.org/tmp/3.2.0-e/wrapper-windows- > x86-32-3.2.0-e.zip >=20 > Leif Mortenson wrote: > > Daniel, > > It is possible to explicitly flush stdout by calling=20 > > fflush(stdout). I added a new wrapper.console.flush=3Dtrue = property,=20 > > which when set to true will do this after > > each line of output logged to the console. Could you try out the=20 > > snapshot below > > with and without the above property and let me know if it makes any=20 > > difference. > > When using the wrapper in normal operation, it doesn't seem to do=20 > > anything at all. The performance tests are unaffected one=20 > way or the=20 > > other. That may be because the command prompt is causing=20 > an automatic=20 > > flush or something. > > > >=20 > http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-windows-x86-32-3 > > .2.0-e.zip > > > > > > Cheers, > > Leif >=20 >=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=3Dlnk&kid=3D103432&bid=3D230486& > dat=3D121642 > _______________________________________________ > 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) *************************************************************************= ************** |
|
From: Leif M. <le...@ta...> - 2006-02-10 15:03:41
|
Daniel,
You are quite welcome. It is already all checked in for the 3.2.0
release. I will leave
the default value false for now until it has been tested more and I am
sure that it does not
have any adverse effects on performance on any platforms.
Be sure to upgrade as soon as the release is out.
Cheers,
Leif
Daniel Mace wrote:
> Leif,
>
> IT WORKS! Awesome. :)
>
> Will this feature/workaround be going into the next release? I'll be
> using this snapshot in the meantime.
>
> It's been a pleasure working on this with you. Many thanks. If there are
> any more specific details you need from me regarding this problem, I'd
> be glad to help.
>
> Thanks again.
>
> Daniel Mace
> Software Engineer, Payroll Integration
> benefitfocus.com
> 843-849-7476 x393
>
>
>
>> -----Original Message-----
>> From: wra...@li...
>> [mailto:wra...@li...] On Behalf
>> Of Leif Mortenson
>> Sent: Friday, February 10, 2006 9:43 AM
>> To: wra...@li...
>> Subject: Re: [Wrapper-user] Wrapper stdout redirection in realtime
>>
>> That link should have been:
>> http://wrapper.tanukisoftware.org/tmp/3.2.0-e/wrapper-windows-
>> x86-32-3.2.0-e.zip
>>
>> Leif Mortenson wrote:
>>
>>> Daniel,
>>> It is possible to explicitly flush stdout by calling
>>> fflush(stdout). I added a new wrapper.console.flush=true property,
>>> which when set to true will do this after
>>> each line of output logged to the console. Could you try out the
>>> snapshot below
>>> with and without the above property and let me know if it makes any
>>> difference.
>>> When using the wrapper in normal operation, it doesn't seem to do
>>> anything at all. The performance tests are unaffected one
>>>
>> way or the
>>
>>> other. That may be because the command prompt is causing
>>>
>> an automatic
>>
>>> flush or something.
>>>
>>>
>>>
>> http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-windows-x86-32-3
>>
>>> .2.0-e.zip
>>>
>>>
>>> Cheers,
>>> Leif
|
|
From: Leif M. <le...@ta...> - 2006-02-10 14:35:58
|
Daniel,
It is possible to explicitly flush stdout by calling
fflush(stdout). I added a new
wrapper.console.flush=true property, which when set to true will do this
after
each line of output logged to the console. Could you try out the
snapshot below
with and without the above property and let me know if it makes any
difference.
When using the wrapper in normal operation, it doesn't seem to do
anything at
all. The performance tests are unaffected one way or the other. That
may be
because the command prompt is causing an automatic flush or something.
http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-windows-x86-32-3.2.0-e.zip
Cheers,
Leif
Daniel Mace wrote:
> Leif,
>
>
>> Strange. I assume you are using the console output of the Wrapper.
>> That output should
>> be getting sent to stdout in pretty much real time. It shows
>> up in the console immediately
>> on all platforms at least. I wonder if there is some kind
>> of a flush
>> that needs to be done
>> that is not needed the way the wrapper is normally used. You
>> might want to try poking
>> around in the logger.c file to see if you have any ideas.
>> The Windows
>> version makes
>> use of the WriteConsole function to write to the console if
>> running as a service and a console is being displayed. Other
>> cases simply write to stdout.
>>
>
> I will take a peek at it today to see if I notice anything obvious...
>
>
>> I'll poke around, but other than flushing ??? Not sure what
>> it would be. Let me know how your program is running. If
>> you are running as a service, then you may need to set the
>> wrapper.ntservice.console property to get a console to capture from.
>>
>
> I apologize! I should have mentioned in my first message: I am running
> in console mode, NOT as a service. Hopefully this will be a clue.
>
> Thanks for the tips. The search continues...
>
> Daniel Mace
> Software Engineer, Payroll Integration
> benefitfocus.com
> 843-849-7476 x393
>
|
|
From: Leif M. <le...@ta...> - 2006-02-10 14:43:31
|
That link should have been: http://wrapper.tanukisoftware.org/tmp/3.2.0-e/wrapper-windows-x86-32-3.2.0-e.zip Leif Mortenson wrote: > Daniel, > It is possible to explicitly flush stdout by calling > fflush(stdout). I added a new > wrapper.console.flush=true property, which when set to true will do > this after > each line of output logged to the console. Could you try out the > snapshot below > with and without the above property and let me know if it makes any > difference. > When using the wrapper in normal operation, it doesn't seem to do > anything at > all. The performance tests are unaffected one way or the other. That > may be > because the command prompt is causing an automatic flush or something. > > http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-windows-x86-32-3.2.0-e.zip > > > Cheers, > Leif |