Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Logging client errors #11363


User avatar
0
uabel created

Is there any way that we can log the client side errors or show them in the popup as well? Here it would be nice if we could see the function incl. exact location and the logged in user. We are using abp 0.7.4

Thanks in advance.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @uabel

    Most of the client side errors are logged with abp.log.log function. abp.log.info and similar functions calls abp.log.log, so you may replace this function to log messages to somewhere else if needed.

    But, note that, still there might be some messages which are not logged by abp.log.log function.

  • User Avatar
    0
    uabel created

    Thank you very much for the answer. Can you then also read out here which call it is? If so, what is the definition for this?

    This is the function, here I try for example to also log the userId: `abp.log.log = function (logObject, logLevel) { if (!window.console || !window.console.log) { return; }

        if (logLevel != undefined && logLevel < abp.log.level) {
            return;
        }
        if (abp.session.userId != null) {
            console.log("UserId: " + abp.session.userId + " " +logObject);
        }
        else
        {
            console.log("UserId: Empty " + logObject);
        }
        
    };`
    
  • User Avatar
    0
    ismcagdas created
    Support Team