Welcome! Log In Create A New Profile

Advanced

User session logging

Posted by norfolk-reg 
User session logging
April 25, 2020 07:41PM
Hi,

I have a sporadic error that happens maybe once every 2-3 days. Try as I may to get a good description of what the user was doing I just cannot replicate the problem. I've tried turning on the server logs, and although that gives me good information about database activity it does not tell me what a user typed of what buttons they pressed. Is anyone aware of an method I could use to log every key pressed and every control clicked in a particular Windev program?

Many thanks
Reg
Al
Re: User session logging
April 26, 2020 02:23AM
Hello Reg

There may be a Windev function that can do that, but for me it is an application design function. I have CtrlInit() and CtrlExit() functions that are run in the Initialization and Exit code of almost every control so while I have no need to collect the data that you require, I could do it by adding the functionality to just those two procedures.

You could add this type of functionality retrospectively by gradually adding this type of functionality to each window in your program.

As an alternative, I also use a procedure GetObjKeyPressed() that runs in the project init as:
 Event("Global_procedures_of_project.GetObjKeyPressed","*.*", 256)

This code picks up every key press in the application. I used it initially to collect the key press of function keys for an application I was converting from DOS Foxpro to Windev many years ago.

LParamNumber is system int = _EVE.wParam
SWITCH _EVE.wParam

	CASE 112 // F1
		//ProjectHelp(currentwin()+".HTM")
	CASE 113 //F2
		SWITCH Upper(CurrentField()) 
			CASE "CRCLEUNIK"
				IF ControlExist("BT_CRCLEUNIK")
					ExécuteTraitement("BT_CRCLEUNIK",trtClic)
				END
There are a also set of VK_??? values that can be picked up with this function VK_NEXT = PageDown key press.
For this to work properly you would need to have the following code in your project init:
//keypress constants
EXTERN "KeyConst.WL"


I had hoped that this function could be used for other things in conjunction with the Windev Typevar() and inputmask but could never get it to work as I required. Maybe you can make this work for your requirements.

Regards
Al
Re: User session logging
April 26, 2020 12:25PM
Hi Al

I've had a play with this idea and it works really well, thanks very much for your help spinning smiley sticking its tongue out
Re: User session logging
April 27, 2020 11:13AM
Have a look at he dbgEnableLog(filename) function. It tells you "what a user typed or what buttons they pressed". Together with all function/procedure calls en even the calling parameters. It result in a file to be opened in Windev.

Quite powerful, it is if you are debugging afterwards.

However this logfile can become quite big, it can grow to several MBs or more in minutes. If it becomes to big Windev can;t handle it very well. So in your situation you need to re-start it every xx minutes and add the datetime stamp to the file for instance. And ask the user to give you the exact time of the error.

Arie
Re: User session logging
April 28, 2020 04:34PM
Hi Arie,

Thanks for that, I will look into it.

Kind Regards
Reg
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: