class_docstr: FileTaskHandler is a python log handler that handles and reads task instance logs.
  
  It creates and delegates log handling to `logging.FileHandler` after receiving task
  instance context.  It reads logs from task instance's host machine.
  
  :param base_log_folder: Base log folder to place logs.
  :param filename_template: template filename string
class_docstr_tok: ["FileTaskHandler","is","a","python","log","handler","that","handles","and","reads","task","instance","logs",".","It","creates","and","delegates","log","handling","to","`","logging.FileHandler","`","after","receiving","task","instance","context",".","It","reads","logs","from","task","instance","'s","host","machine",".",":","param","base_log_folder",":","Base","log","folder","to","place","logs",".",":","param","filename_template",":","template","filename","string"]
docstr: Given TI, generate URL with which to fetch logs from service log server.
docstr_tok: ["Given","TI",",","generate","URL","with","which","to","fetch","logs","from","service","log","server","."]
code: def _get_log_retrieval_url(
      self,
      ti: TaskInstance,
      log_relative_path: str,
      log_type: LogType | None = None,
  ) -> tuple[str, str]:
      """Given TI, generate URL with which to fetch logs from service log server."""
      if log_type == LogType.TRIGGER:
          if not ti.triggerer_job:
              raise RuntimeError(
                  "Could not build triggerer log URL; no triggerer job."
              )
          config_key = "triggerer_log_server_port"
          config_default = 8794
          hostname = ti.triggerer_job.hostname
          log_relative_path = self.add_triggerer_suffix(
              log_relative_path, job_id=ti.triggerer_job.id
          )
      else:
          hostname = ti.hostname
          config_key = "worker_log_server_port"
          config_default = 8793
      return (
          urljoin(
              f"http://{hostname}:{conf.get('logging', config_key, fallback=config_default)}/log/",
              log_relative_path,
          ),
          log_relative_path,
      )
  
imports: from __future__ import annotations
  import inspect
  import logging
  import os
  import warnings
  from contextlib import suppress
  from enum import Enum
  from functools import cached_property
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Iterable
  from urllib.parse import urljoin
  import pendulum
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, RemovedInAirflow3Warning
  from airflow.executors.executor_loader import ExecutorLoader
  from airflow.utils.context import Context
  from airflow.utils.helpers import parse_template_string, render_template_to_string
  from airflow.utils.log.logging_mixin import SetContextPropagate
  from airflow.utils.log.non_caching_file_handler import NonCachingFileHandler
  from airflow.utils.session import create_session
  from airflow.utils.state import State, TaskInstanceState
label_desc: Use image node_id 13 for calling the FileTaskHandler obj's underlying member method code with example usage: obj._get_log_retrieval_url(ti, log_relative_path, log_type) and returns: urljoin,  log_relative_path