code: def satosa_logging(logger, level, message, state, **kwargs):
      
      if state is None:
          session_id = "UNKNOWN"
      else:
          try:
              session_id = state[LOGGER_STATE_KEY]
          except KeyError:
              session_id = uuid4().urn
              state[LOGGER_STATE_KEY] = session_id
      logger.log(level, "[{id}] {msg}".format(id=session_id, msg=message), **kwargs)
docs: Adds a session ID to the message.
  
      :type logger: logging
      :type level: int
      :type message: str
      :type state: satosa.state.State
  
      :param logger: Logger to use
      :param level: Logger level (ex: logging.DEBUG/logging.WARN/...)
      :param message: Message
      :param state: The current state
      :param kwargs: set exc_info=True to get an exception stack trace in the log