private String getRequestUser(HookContext hookContext) {
      String requestUser = hookContext.getUserName();
      if (requestUser == null) {
        requestUser = hookContext.getUgi().getUserName();
      }
      return requestUser;
    }
Log events from hive hook using protobuf serialized format, partitioned by date.
ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java