server: proxy: improve logs
authorKobi Mizrachi <kmizrachi18@gmail.com>
Tue, 28 Jan 2020 13:36:21 +0000 (15:36 +0200)
committerakallabeth <akallabeth@users.noreply.github.com>
Mon, 10 Feb 2020 08:37:54 +0000 (09:37 +0100)
server/proxy/pf_client.c
server/proxy/pf_update.c

index a225629..5c7ee62 100644 (file)
@@ -147,7 +147,7 @@ static BOOL pf_client_pre_connect(freerdp* instance)
         * Load all required plugins / channels / libraries specified by current
         * settings.
         */
-       WLog_INFO(TAG, "Loading addins");
+       LOG_INFO(TAG, pc, "Loading addins");
 
        if (!pf_client_load_rdpsnd(pc, config))
        {
@@ -157,7 +157,7 @@ static BOOL pf_client_pre_connect(freerdp* instance)
 
        if (!freerdp_client_load_addins(instance->context->channels, instance->settings))
        {
-               WLog_ERR(TAG, "Failed to load addins");
+               LOG_ERR(TAG, pc, "Failed to load addins");
                return FALSE;
        }
 
@@ -312,9 +312,13 @@ static BOOL pf_client_connect_without_nla(pClientContext* pc)
 static BOOL pf_client_connect(freerdp* instance)
 {
        pClientContext* pc = (pClientContext*)instance->context;
+       rdpSettings* settings = instance->settings;
        BOOL rc = FALSE;
        BOOL retry = FALSE;
 
+       LOG_INFO(TAG, pc, "connecting using client info: Username: %s, Domain: %s", settings->Username,
+                settings->Domain);
+
        pf_client_set_security_settings(pc);
        if (pf_client_should_retry_without_nla(pc))
                retry = pc->allow_next_conn_failure = TRUE;
index 176821c..83fed48 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <freerdp/display.h>
+#include <freerdp/session.h>
 #include <winpr/image.h>
 #include <winpr/sysinfo.h>
 
@@ -188,7 +189,25 @@ static BOOL pf_client_save_session_info(rdpContext* context, UINT32 type, void*
        pClientContext* pc = (pClientContext*)context;
        proxyData* pdata = pc->pdata;
        rdpContext* ps = (rdpContext*)pdata->ps;
+       logon_info* logonInfo = NULL;
+
        WLog_DBG(TAG, __FUNCTION__);
+
+       switch (type)
+       {
+               case INFO_TYPE_LOGON:
+               case INFO_TYPE_LOGON_LONG:
+               {
+                       logonInfo = (logon_info*)data;
+                       LOG_INFO(TAG, pc, "client logon info: Username: %s, Domain: %s", logonInfo->username,
+                                logonInfo->domain);
+                       break;
+               }
+
+               default:
+                       break;
+       }
+
        return ps->update->SaveSessionInfo(ps, type, data);
 }