code: private void _inferCaller()
    {
      _needToInferCaller = false;
      // Get the stack trace.
      StackTraceElement stack[] = (new Throwable()).getStackTrace();
      // First, search back to a method in the Logger class.
      int i = 0;
  
      while (i < stack.length)
      {
        StackTraceElement frame = stack[i];
        String cname = frame.getClassName();
        if (cname.equals(_JDK_LOG_CLASS) ||
            cname.equals(_MYFACES_LOG_CLASS))
        {
            break;
        }
  
        i++;
      }
  
      // Now search for the first frame before the "Logger" class.
      while (i < stack.length)
      {
        StackTraceElement frame = stack[i];
        String cname = frame.getClassName();
  
        if (cname.equals(_JDK_LOG_CLASS) ||
            cname.equals(_MYFACES_LOG_CLASS))
        {
          i++;
          continue;
        }
  
        String mname = frame.getMethodName();
        if ("log".equals(mname) ||
            "_log".equals(mname))
        {
          i++;
          continue;
        }
  
        // We've found the relevant frame.
        setSourceClassName(cname);
        setSourceMethodName(mname);
        return;
  
      }
  
      // Forcibly set both to null, so the LogRecord superclass
      // doesn't try to detect them on its own
      setSourceClassName(null);
      setSourceMethodName(null);
    }
docs: Private method to infer the caller's class and method names