### Apache Airflow version

2.2.5

### What happened

in a worker container, a flask app is spun up to serve task log files that is read by the webserver and rendered to the user in the UI.  The log files cannot be read if you overwrite the task handler's base_log_folder value. (404 error)
 ie. in the airflow.cfg, the base_log_folder = `foo/bar/logs`, and the task handler uses `{base_log_folder}/dags`



### What you think should happen instead

in https://github.com/apache/airflow/blob/main/airflow/utils/serve_logs.py#L33, it should read the logging config's task handler log location.

### How to reproduce

use a custom logging config, override the task's base log folder. 
Run a dag and try to view logs in the ui, you will get a 404

```
LOGGING_CONFIG["handlers"].update(
    {
        "task": {
            "class":  "airflow.utils.log.file_task_handler.FileTaskHandler",
            "formatter": "airflow",
            "base_log_folder": f"{BASE_LOG_FOLDER}/dags",
            "filename_template": FILENAME_TEMPLATE,
            "filters": ["mask_secrets"],
        },
  }
```

### Operating System

ubuntu

### Versions of Apache Airflow Providers

_No response_

### Deployment

Virtualenv installation

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

with time_machine.travel(datetime.datetime.utcnow() - datetime.timedelta(seconds=40)):
            token = signer.generate_signed_token({"filename": "sample.log"})
        assert (
            client.get(
                "/log/sample.log",
                headers={
                    "Authorization": token,
                },
            ).status_code
            == 403
        )
    def test_wrong_audience(self, client: FlaskClient, different_audience):
        assert (
            client.get(
                "/log/sample.log",
                headers={
                    "Authorization": different_audience.generate_signed_token({"filename": "sample.log"}),
                },
            ).status_code
            == 403
        )
    @pytest.mark.parametrize("claim_to_remove", ["iat", "exp", "nbf", "aud"])
    def test_missing_claims(self, claim_to_remove: str, client: FlaskClient, secret_key):