Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread LogOutput
Wed, Nov 18 2015 12:41 PMPermanent Link

Uli Becker

Can I use LogOutput only with the built in internal webserver? If not (I
use the EWB Server with modules): how can I get it to work?

Thanks

Uli
Wed, Nov 18 2015 1:22 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 11/18/2015 12:41 PM, Uli Becker wrote:
> Can I use LogOutput only with the built in internal webserver? If not (I
> use the EWB Server with modules): how can I get it to work?

AFAIK it's useable by default only with IDE web server.

Where would you show the output when running outside IDE ?

Default URL for logoutput is "http://localhost/log" so you'd need to be
on the same PC as server.

You can call it with 2nd parameter specifying the URL (i.e.
LogOutput('my message','http://my url') so it coudl work with any web
server (it's just a TServerRequest doing post).

You'd still need a custom module to handle it though in the back end and
then somehow display it (module to save to table and then you can
retrieve it with tdataset or such).

However for client side logging during development i found it easier to
just build my own little global logging class that stores the strings
and then show in a form with memo if needed).

Raul
Wed, Nov 18 2015 2:27 PMPermanent Link

Uli Becker

Raul,

thanks. A global class is a good idea. I will do it like this.

Uli
Wed, Nov 18 2015 3:10 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Can I use LogOutput only with the built in internal webserver? >>

Yes.

However, if you want to do your own custom logging, all you need is to handle such post requests using your module (you would, of course, need to use a slightly different URL as the second parameter to the LogOutput procedure).  The pseudo-code (Delphi) would look like this:

     ResponseHeaders.Add('Cache-Control: no-cache');
     if SameText(RequestMethod,'POST') then
        begin
        if SameText(ResourceName,'log') then
           begin
           // Do something
           end

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Nov 19 2015 1:57 AMPermanent Link

Uli Becker

Tim,

> However, if you want to do your own custom logging, all you need is to handle such post requests using your module (you would, of course, need to use a slightly different URL as the second parameter to the LogOutput procedure).  The pseudo-code (Delphi) would look like this:
>
>        ResponseHeaders.Add('Cache-Control: no-cache');
>        if SameText(RequestMethod,'POST') then
>           begin
>           if SameText(ResourceName,'log') then
>              begin
>              // Do something
>              end

Looks good, I'll try both this and Raul's solution.

Thanks Uli
Image