NetTalk Central

Author Topic: Log to disk  (Read 5481 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Log to disk
« on: June 12, 2020, 08:48:00 AM »
Hi, I have a server who suddenly stops working
I think may be its a halt or a stop, but I never see it, the real thing is that it suddenly disapears
I set the log to Display&disk but I never see any log file in the log dir
Or any way to debug it?
How to do it?
« Last Edit: June 12, 2020, 09:10:33 AM by michelis »
-----------
Regards
Alberto

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Log to disk
« Reply #1 on: June 12, 2020, 03:43:53 PM »
Simple steps to log to disk:

1. Create a global string variable GLO:MyLogFileName
2. Create a table.    Full Path Name:  !GLO:MyLogFileName;  In it, add a field: Line1 STRING(4000)
3. In your Web Server procedure, open the Logging Controls extension template
4. Fill in the fields for table, field, and GLO:MyLogFileName

Run the app.  Enable log to disk.  Log file will be created in the LOG folder.
If you're using an ASCII file, you will probably need to turn OFF log to disk to flush the records to disk.

HTH

Jane

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Log to disk
« Reply #2 on: June 13, 2020, 06:39:58 AM »
Thanks Jane!!!
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Log to disk
« Reply #3 on: June 17, 2020, 04:59:30 AM »
Ok, I have a problem.
The log is saved ok to Disk while the server is up running.
I can inspect the log file while the server is running and if I close it.
Its an Ascii file.
but...
When the server halts by, I dont know which error, the log file is deleted.
The server stop running and the log file is not there.

I have some HALTS() mhhh may be I have to close the ascii file before...

Another thing I dont understand if why there are more tahn one log file in the same run, beein the logs as little as 3kb. See pic
« Last Edit: June 17, 2020, 12:02:00 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Log to disk
« Reply #4 on: June 17, 2020, 11:05:09 PM »
each time you run the program it will start a new log file.

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Log to disk
« Reply #5 on: June 20, 2020, 04:21:53 AM »
Thats no what its happening here, without closing the server there are many .log files, see pic.
Theres a new log file each MINUTE (if there are anything to log)
« Last Edit: June 20, 2020, 04:26:46 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Log to disk
« Reply #6 on: June 22, 2020, 10:31:33 PM »
A new log file is created in the NetWebServer.OpenLog method if the file size exceeds Bytes(p_File) > self.MaxLogSize,
or if the log file is closed.

So perhaps add some trace code in there to determine which is happening. Also, if you CLOSE the log file then it'll have this effect.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Log to disk
« Reply #7 on: June 23, 2020, 06:51:00 AM »
Im not closing the file.
Ive added some trace lines and I dont understand why the file gets status=0
Please see pics.
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Log to disk
« Reply #8 on: June 23, 2020, 06:46:37 PM »
>> I've added some trace lines and I dont understand why the file gets status=0

yeah. That would definitely be the thing to figure out. clearly it's being closed by something...

cheers
Bruce


Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Log to disk
« Reply #9 on: June 24, 2020, 03:58:12 AM »
Another weird thing...
Today is 6/24/2020 and theres a new log file, but ... I cant delete the file from 6/23/2020, its in use.
See pic.

My log file is threaded... my fault
« Last Edit: June 24, 2020, 04:19:52 AM by michelis »
-----------
Regards
Alberto