How to get the PID in Server Side program?

Posted by marumaro on 18-Oct-2011 04:15

Hi all,

  I put the below code in the as_activate.p to log the current user login.

As I want to save the current user login (user1) and PID (P-000488) in another log file.

Anyone know how to get the PID in Server Side program. Thanks.

Code:

message DYNAMIC-FUNCTION('getPropertyList':U IN gshSessionManager, 'currentUserLogin':U, NO).

Output in server log:

[11/10/18@14:25:30.863+0800] P-000488 T-002712 1 AS -- (Procedure: 'as_activate.p' Line:183) user1

appserver.jpg

All Replies

Posted by AdrianJones on 18-Oct-2011 05:12

def var cbtchLogWriter_ProcessID as char no-undo.

FOR FIRST _MyConnection NO-LOCK:
   
        ASSIGN cbtchLogWriter_ProcessID = STRING(_MyConnection._Myconn-Pid).
    END.

This thread is closed