docstr: Publish Query Summary to remote logging server
docstr_tok: ["Publish","Query","Summary","to","remote","logging","server"]
code: def publish(self) -> None:
      """
      Publish Query Summary to remote logging server
      """
      api_key = None
      server_url = None
  
      if self._server_config is None:
          server_url = os.environ.get("LOGGING_SERVER_URL")
          api_key = os.environ.get("LOGGING_SERVER_API_KEY")
      else:
          server_url = self._server_config.get(
              "server_url", os.environ.get("LOGGING_SERVER_URL")
          )
          api_key = self._server_config.get(
              "api_key", os.environ.get("LOGGING_SERVER_API_KEY")
          )
  
      if api_key is None or server_url is None:
          return
  
      try:
          log_data = {
              "json_log": self.get_summary(),
          }
          headers = {"Authorization": f"Bearer {api_key}"}
          response = requests.post(
              f"{server_url}/api/log/add",
              json=log_data,
              headers=headers,
          )
          if response.status_code != 200:
              raise Exception(response.text)
  
          json_data = json.loads(response.text)
  
          if "data" in json_data and json_data["data"] is not None:
              self._last_log_id = json_data["data"]["log_id"]
  
      except Exception as e:
          print(f"Exception in APILogger: {e}")
  
imports: import base64
  import json
  import os
  import time
  from typing import Any, List, TypedDict, Union
  import uuid
  import requests
  from collections import defaultdict
label_desc: Use image node_id 13 for calling the QueryExecTracker obj's underlying member method code with example usage: obj.publish() without return types