Extend Log by client/user informations

29 views
Skip to first unread message

Norbert Bede

unread,
Oct 22, 2019, 10:03:01 AM10/22/19
to iDempiere
hi,

I would like to collect logs from java servers/noes and analyze them. ATM no all required data are available, like the user, client name other custom definable data.
is it possible to somehow get the above data to the server log?

thanks
norbert

Nicolas Micoud

unread,
Oct 22, 2019, 12:26:23 PM10/22/19
to iDempiere
Hi Norbert,

FWIW, I've added the following method in a plugin


    public static void addDebugLog(Properties ctx, String text)
   
{
       
if (MSysConfig.getBooleanValue(XXA_DEBUG_MODE, false, Env.getAD_Client_ID(ctx))) {
            log
.warning("SessionID=" + Env.getContext(ctx, "#AD_Session_ID")
                   
+ " - ClientID=" + Env.getAD_Client_ID(ctx)
                   
+ " - UserID=" + Env.getAD_User_ID(ctx)
                   
+ " : " + text);
       
}
   
}

It is called by my plugin to have all required info in the log file (if the related SysConfig - client leve - is set to Y).

Regards,

Nicolas
Reply all
Reply to author
Forward
0 new messages