Bug: [FEATURE] Add logger for sessions call failure



### Feature Description

Add a logger for failure of sessions call when the call fails at connector's end.

### Possible Implementation

Add a logger for failure of sessions call when the call fails at connector's end.

### Have you spent some time checking if this feature request has been raised before?

- [X] I checked and didn't find a similar issue

### Have you read the Contributing Guidelines?

- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

Yes, I am willing to submit a PR!
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index d459fef935e..8935c3ac0ee 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -1740,7 +1740,7 @@ where
                 if let Ok(router_types::PaymentsResponseData::SessionResponse {
                     session_token,
                     ..
-                }) = connector_response.response
+                }) = connector_response.response.clone()
                 {
                     // If session token is NoSessionTokenReceived, it is not pushed into the sessions_token as there is no response or there can be some error
                     // In case of error, that error is already logged
@@ -1751,13 +1751,16 @@ where
                         payment_data.sessions_token.push(session_token);
                     }
                 }
+                if let Err(connector_error_response) = connector_response.response {
+                    logger::error!(
+                        "sessions_connector_error {} {:?}",
+                        connector_name,
+                        connector_error_response
+                    );
+                }
             }
-            Err(connector_error) => {
-                logger::error!(
-                    "sessions_connector_error {} {:?}",
-                    connector_name,
-                    connector_error
-                );
+            Err(api_error) => {
+                logger::error!("sessions_api_error {} {:?}", connector_name, api_error);
             }
         }
     }
diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rs
index 518d1aa1a79..0c6ce07e51a 100644
--- a/crates/router/src/services/api.rs
+++ b/crates/router/src/services/api.rs
@@ -332,6 +332,7 @@ where
                                             if let Some(status) = error_res.attempt_status {
                                                 router_data.status = status;
                                             };
+                                            state.event_handler().log_event(&connector_event);
                                             error_res
                                         }
                                     };

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Add a logger for failure of sessions call when the call fails at connector's end.

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/issues/5037

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
The following logs should be checked:
1. Session call fails without calling connector:

- Payments Create(Klarna): 

Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jOiTovkpGinwxAIGAlEyC9SiVkJCfK3Tc1NNOntnkLMaeaM7U7xtde8a88LhPVlm' \
--data-raw '{
    "amount": 6500,
    "client_secret": "pay_QWcuxERT26fPFELkA1d6_secret_m9LRWGDRVRckiKvfnNUZ",
    "currency": "USD",
    "customer_id": "cdsdcwmn",
    "customer": {
        "id": "cdsdcwmn",
        "email": "user@gmail.com"
    },
    "confirm": false,
    "description": "Hello this is description",
    "setup_future_usage": "on_session",
    "capture_method": "automatic",
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
     "shipping": {
        "address": {
            "line1": "444, Stelar Enclave",
            "line2": "California",
            "line3": "Groningen",
            "city": "Groningen",
            "state": "Groningen",
            "zip": "94105",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "446681800",
            "country_code": "+41"
        }
    },
    "order_details": [
        {
            "amount": 6500,
            "quantity": 1,
            "product_name": "Apple iphone 15"
        }
    ],
    "email": "user@gmail.com",
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    }
}'
```

Response:
```
{
    "payment_id": "pay_tVGVQM83dIDCw3ruJ2rW",
    "merchant_id": "merchant_1718782884",
    "status": "requires_payment_method",
    "amount": 6500,
    "net_amount": 6500,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_tVGVQM83dIDCw3ruJ2rW_secret_5yzEyo6XRKmikqS1mAvM",
    "created": "2024-06-19T08:02:28.968Z",
    "currency": "USD",
    "customer_id": "cdsdcwmn",
    "customer": {
        "id": "cdsdcwmn",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Groningen",
            "country": "US",
            "line1": "444, Stelar Enclave",
            "line2": "California",
            "line3": "Groningen",
            "zip": "94105",
            "state": "Groningen",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "446681800",
            "country_code": "+41"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": null,
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cdsdcwmn",
        "created_at": 1718784148,
        "expires": 1718787748,
        "secret": "epk_4f84615faf66473aa1a1344bb10d014a"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_rDD29g488ZjT3dFTLs9s",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-19T08:17:28.968Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-19T08:02:28.986Z",
    "charges": null,
    "frm_metadata": null
}
```

- Session Token:

Request:
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_d36f99efb52a4dd891bca3d9bd9c8842' \
--data '{
    "payment_id": "pay_tVGVQM83dIDCw3ruJ2rW",
    "wallets": [],
    "client_secret": "pay_tVGVQM83dIDCw3ruJ2rW_secret_5yzEyo6XRKmikqS1mAvM"
}'
```

Response:
```
{
    "payment_id": "pay_tVGVQM83dIDCw3ruJ2rW",
    "client_secret": "pay_tVGVQM83dIDCw3ruJ2rW_secret_5yzEyo6XRKmikqS1mAvM",
    "session_token": []
}
```

Logs:
<img width="1308" alt="Screenshot 2024-06-19 at 1 33 09 PM" src="https://github.com/juspay/hyperswitch/assets/41580413/9eba4aba-687b-42b1-86cb-048ef19a1d79">

2. Session Call fails at connector:
NOTE: To generate this error enter wrong api credentials for Klarna while creating the connector
- Payments Create (Klarna):

Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jOiTovkpGinwxAIGAlEyC9SiVkJCfK3Tc1NNOntnkLMaeaM7U7xtde8a88LhPVlm' \
--data-raw '{
    "amount": 6500,
    "client_secret": "pay_QWcuxERT26fPFELkA1d6_secret_m9LRWGDRVRckiKvfnNUZ",
    "currency": "USD",
    "customer_id": "cdsdcwmn",
    "customer": {
        "id": "cdsdcwmn",
        "email": "user@gmail.com"
    },
    "confirm": false,
    "description": "Hello this is description",
    "setup_future_usage": "on_session",
    "capture_method": "automatic",
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "order_details": [
        {
            "amount": 6500,
            "quantity": 1,
            "product_name": "Apple iphone 15"
        }
    ],
    "email": "user@gmail.com",
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    }
}'
```

Response:
```
{
    "payment_id": "pay_eJNLxe3merOzC4Ne0yBk",
    "merchant_id": "merchant_1718782884",
    "status": "requires_payment_method",
    "amount": 6500,
    "net_amount": 6500,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_eJNLxe3merOzC4Ne0yBk_secret_e8cDuFl2f0flJTbXnx9s",
    "created": "2024-06-19T08:14:18.074Z",
    "currency": "USD",
    "customer_id": "cdsdcwmn",
    "customer": {
        "id": "cdsdcwmn",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": null,
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cdsdcwmn",
        "created_at": 1718784858,
        "expires": 1718788458,
        "secret": "epk_c15cf7f5abb74cc79d7d5135d7b7bbf1"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_rDD29g488ZjT3dFTLs9s",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-19T08:29:18.073Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-19T08:14:18.149Z",
    "charges": null,
    "frm_metadata": null
}
```

- Session Token:

Request:
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_d36f99efb52a4dd891bca3d9bd9c8842' \
--data '{
    "payment_id": "pay_eJNLxe3merOzC4Ne0yBk",
    "wallets": [],
    "client_secret": "pay_eJNLxe3merOzC4Ne0yBk_secret_e8cDuFl2f0flJTbXnx9s"
}'
```

Response:
```
{
    "payment_id": "pay_eJNLxe3merOzC4Ne0yBk",
    "client_secret": "pay_eJNLxe3merOzC4Ne0yBk_secret_e8cDuFl2f0flJTbXnx9s",
    "session_token": []
}
```

Logs:
<img width="1308" alt="Screenshot 2024-06-19 at 1 32 03 PM" src="https://github.com/juspay/hyperswitch/assets/41580413/0d5c5c74-59a1-4448-b933-15c60787bd66">


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
