[NTLK] NPDS 2.1x Question

Sylvain Pilet pilets at mac.com
Thu Feb 25 21:32:37 EST 2016


Hi Morgan, and all,

Well, thank you for your answers,
I did not understand, I thought that these commands were accessible from NPDS.

Indeed the log file = big problem, according to the frequency of visits WebSite hosted by NPDS, the file can quickly become large. On my first NPDS, this file already reaches several times over 400k or more.

In my dreams this is what I like:
- A function in nHTTPd would send each day (at 2am by example) a mail (to address sets) with the logs of the last 24 hours. Then this script deletes the logs after, so the file is always light.
It takes a lot of work in the code, since we integrated the email shipment management. Especially if the user has not installed and configured MailV (or another mail app).


Otherwise currently I "play" with NPDS sources, I try to understand how all the codes work (but my programmer level is very far from that of Paul G.) Fortunately for me, Paul commented the code in French, this is it nice for me! ;-)

I used the my Template project for Greg aka "Doctor Clu" (OASIS NPDS <http://99.88.169.88:8080>) to test my changes in NPDS on my local Newton/NPDS (see at: <http://message-pad.no-ip.org:2101>).

I have some small problems to solve…
I "broken" the management of Newton/Browsers (NetHopper, NewtsCape ...) who receive some HTML/CSS lines that I do not wish that they receive (for example, it blocks NewtsCape in some cases). I would have included a condition with […(not: UsingNewtonBrowser (theRequest))…] to solve this…

All this takes time, especially when one dives into the code made by others. 
Fortunately (again) the code is very well documented, thank you also to those who worked on it in the past.
Anyway, I try to change NPDS, and I have dozens of ideas… ;-)


Best regards


Sylvain Pilet

- A P P L E  N E W T O N  N P D S -
- Apple Newton NPDS Server: http://message-pad.no-ip.org
- Apple Newton NPDS Tracker: http://message-pad.no-ip.org:3680

- A P P L E  N E W T O N  &  M O R E -
- http://message-pad.net

Le 25 févr. 2016 à 16:53, Grant Hutchinson <grant at splorp.com> a écrit :

> 
> On 2016-02-24, at 5:32 PM, Sylvain Pilet wrote:
> 
>> On nHTTPd 2.1x
>> I saw that there are two functions:
>> LogToTextfile
>> LogToWorks
>> 
>> My question, I do not understand how to access these features from NPDS.
>> Can anyone explain?
> 
> Those functions are accessible via NewtonScript and allow you to export the nHTTPd server log data. Here is some information from Paul Guyot lifted from as old NPDS Mailing List thread:
> 
> 
>>> Can somebody confirm for me that logging works in 2.101?  I cannot get
>>> it to work:  I get an Internal Server Error.  The /cfg page loads fine,
>>> but when it goes to produce the log it fails.
>> 
>> Well, sort of. Logging _is_ working in 2.101, but log viewing is
>> temporarily busted.
> 
> Actually, it could kill the server in 2.1 if the log was too big.
> 
>> In the meantime, you can export the log file to either Notepad or
>> NewtWorks using one of the following NewtonScript calls - :LogToTextFile
>> or :LogToWorks
> 
> LogToTextFile doesn't export to the notepad but exports to text.
> 
> You have two options (to put in a DashBord or NPDS script)
> 
> GetRoot().paperroll:MakeTextNote(GetRoot().|nHTTPd:ALLPEN|:LogToTextFile(nil), true);
> 
> GetRoot().|nHTTPd:ALLPEN|:LogToWorks(nil);
> 
> 
> Grant
> 
> ----------------------------------------------------------------------
> 
> Grant Hutchinson
> NewtonTalk List Dad & Web Custodian
> 
> 
> ----------------------------------------------------------------------
> 
> http://newtontalk.net/
> http://twitter.com/newtontalk



More information about the NewtonTalk mailing list