Having trouble to dbug some procedures that remotelly connect to appserver, so i came to this way of logging.
I remeber have seen a better way. Hoping someone to point me in that direction.
&SCOPED-DEFINE logging YES DEFINE STREAM dbg. &scoped-define logit OUTPUT STREAM dbg TO value(SESSION:TEMP-DIRECTORY + "dbg.txt") APPEND. ~ PUT STREAM dbg SKIP(1) NOW " ". &scoped-define CloseIt OUTPUT STREAM dbg CLOSE. ... &if {&logging} &then {&logit} PUT STREAM dbg "Getting connection". {&CloseIt} &endif GET-KEY-VALUE SECTION "CONNECTION" KEY "AppServerUser" VALUE pUsuario. GET-KEY-VALUE SECTION "CONNECTION" KEY "SucursalAppServer" VALUE t1Char.
Thanks... but I'm just begging to debug at the client side... wan't to see why the program crahses the session of the users and statrts over...
Some funcition on the initializing procedures of a .W is crashing the entire user's session.
PS: and on the server I use
MESSAGE "this....". //wihout the view-as....
You can turn on client side tracing by including this in the client startup command
-clientlog c:\tmp\mylog.lg -logginglevel 4 -logentrytypes 4GLTrace:4 -debugalert
You may need to enable debugging for the openedge environment for both the client and the appserver with proDebugEnable -enable-all
There is also KB article 000001305 you could look at.
If you're on widows, there is a GUI version of the unix 'tail' command called 'Wintail'. Saved my mind a number of times.
Cheers, Tony.
Thanks!!!!
Way more clever than reinventing the wheel!!!
We use a combination of PUBLISH and the LOG-MANAGER. At the start of each program we do a call to initiate the logger. This logger is started persistently and checks in a database table whether it is active or not for that particular program. If it is active, it will subscribe to the "debugMessage" event. Inside our programs we have lots of publishes like this:
PUBLISH "debugMessage" (1, "some interesting message here").
Whenever the logger receives this, it writes the string and the level number it receives to the log-manager. Works like a charm and the good part is that you do not have to change and recompile your program when you want to switch on debugging. You can do this even in production. As a matter of fact, we do. By default all logging is off in production, but if needed we can turn it on. Having PUBLISH statements without a receiving procedure listening (which is the normal situation) is hardly noticable in terms of performance.
Patrick,
Do you have a similar pattern for OOABL-based programs?
why would you have to it a different way for oo ???
ignorant minds want to know.
For OO.. it seems the event model would work if you wanted to mirror the example.
I usually just make a static utility class/methods that all of the other classes can use with log management and other useful things (tablestats, indexstats, turing on/off the profiler, etc).
Thanks Patrick, and all....
Wonder if you could provide a little detailed howto on the scheme you mention? It sounds very solid. and us very weak can get strength on the way.