NetTalk Central

Author Topic: WebServer Logging to Disk issue  (Read 677 times)

kboller

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
WebServer Logging to Disk issue
« on: June 11, 2025, 10:37:35 AM »
I'm trying to turn on Logging to Disk.  I'm using an ASCII file and have entered the file information in the WebServer logging extension.  However when I do that, the log file is never created (and no log file records as well obviously).

I then added code in the AddLog procedure to manually create the record.  However it only creates the first entry and then stops adding records after that.

Any suggestions as to what's going on and how to resolve it?  Here is my code where the record is added:

      ! Start of "Before Adding to Log Queue"
      ! [Priority 5000]
      !Before add to Log Que
      If web:EnableLogging = 2
        Clear(WebLogFile:Record)
        Log:Line = format(Today(),@D3)&format(Clock(),@T3)&' -- '&clip(p_Data)&','&p_ip   
        Access:WebLogFile.Insert()
      end
      ! End of "Before Adding to Log Queue"
      Add(LogQueue,1)
      Loop While Records(LogQueue) > 500
        Get(LogQueue,501)
        Delete(LogQueue)
      End

Thanks,

Kurt

rjolda

  • Sr. Member
  • ****
  • Posts: 371
    • View Profile
    • Email
Re: WebServer Logging to Disk issue
« Reply #1 on: June 12, 2025, 08:09:30 AM »
Hi Kurt,
I have not played with the Save to Disk function for logs and I am on the road. I have found that many things in NT get solved by snooping around and trying to make sense of the stuff around what you are trying to do.
First, I believe it is an ASCII file.   Is there a RETURN added at the end of each line?  I am not sure if it is added automatically but if there isn't any and the line length is BIG - it may appear to have only one record?
The logins are apparently recorded in a queue.  I would look at the queue and see what is there and make sure that you have the correct item to write to your file.  eg -  I am not sure if it takes each addition to the queue and runs the record from this routine or if this routine needs to fetch the last queue record to have it to write to disk.
I might use and ADD(record) as opposed to Insert record as it is an AScII file.
Poking around with some messages or trace statements will help you sort this out.
Sorry I don't have an answer but I find that with some information and direction, the answer can often be sorted out.
Ron

kboller

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: WebServer Logging to Disk issue
« Reply #2 on: June 12, 2025, 12:38:40 PM »
Hi Ron,

     Regarding the RETURN, I think it is adding one.  If you close the webapp and reopen it, it does add an additional record to the log file.  The record length is currently 1024 so it is large but doesn't appear to fill the record with blanks.  You can open it with notepad and see it's performing a carriage return at the end of the record.

      I did use the Add(record) and got the same results as the Insert record.  It only adds the one record even though with trace statements it shows that the code is being executed.

Thanks,

Kurt

Alberto

  • Hero Member
  • *****
  • Posts: 1888
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: WebServer Logging to Disk issue
« Reply #3 on: June 12, 2025, 05:48:02 PM »
Hi,
Had you checked the insert error in
Access:WebLogFile.Insert()
Are you sure the file is open?
-----------
Regards
Alberto

rjolda

  • Sr. Member
  • ****
  • Posts: 371
    • View Profile
    • Email
Re: WebServer Logging to Disk issue
« Reply #4 on: June 14, 2025, 03:25:13 AM »
Hi Kurt,
FWIW, I have a separate table of LOGINS.  It is a TPS file.  I am able to use this to record each VALID login to the system.  I write a record to it after I validate each login.  That may be a better solution for you if you are trying to track valid logins.  BTW, make sure that the additional table is OPENED when you write to it - either have the procedure open and close it or you must do it yourself.
Ron