Repository: open-feature/java-sdk (java)

Issue:
Improve error logs when flag evaluation failed
Current SDK emits following log line when a flag evaluation fails, 

`Unable to correctly evaluate flag with key <flag_key> due to exception <exception_message>`

Ex:- from Java getting started guide when flagd is not up and running 

<img width="1687" alt="image" src="https://user-images.githubusercontent.com/8186721/216461349-0d54c402-b672-42b6-88bb-bbb1c8ca4d75.png">

This error hides the exception stack trace, making it difficult to debug errors. 

**Proposal** 

Include the stack trace for better error details 


Pull request:
fix: improve error logs for evaluation failure
## This PR

Fixes #275

Consider the following log entry with detailed logs explaining the underlying issue by logging stacktrace, 

<img width="1360" alt="image" src="https://user-images.githubusercontent.com/8186721/216462684-6922df6f-1d43-4727-a58c-35f4af497a5c.png">




Patch:
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
index 0095abc..a13eb94 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
@@ -137,7 +137,7 @@ public class OpenFeatureClient implements Client {
             details = FlagEvaluationDetails.from(providerEval, key);
             hookSupport.afterHooks(type, hookCtx, details, mergedHooks, hints);
         } catch (Exception e) {
-            log.error("Unable to correctly evaluate flag with key {} due to exception {}", key, e.getMessage());
+            log.error("Unable to correctly evaluate flag with key '{}'", key, e);
             if (details == null) {
                 details = FlagEvaluationDetails.<T>builder().build();
             }


Test patch:
diff --git a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
index 35f83fd..24bb8d3 100644
--- a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
+++ b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
@@ -1,6 +1,7 @@
 package dev.openfeature.sdk;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.InstanceOfAssertFactories.optional;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -15,6 +16,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.ImmutableList;
+import dev.openfeature.sdk.exceptions.FlagNotFoundError;
 import io.cucumber.java.hu.Ha;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
@@ -206,7 +209,14 @@ class FlagEvaluationSpecTest implements HookFixtures {
         Client c = api.getClient();
         FlagEvaluationDetails<Boolean> result = c.getBooleanDetails("test", false);
         assertEquals(Reason.ERROR.toString(), result.getReason());
-        assertThat(TEST_LOGGER.getLoggingEvents()).contains(LoggingEvent.error("Unable to correctly evaluate flag with key {} due to exception {}", "test", TestConstants.BROKEN_MESSAGE));
+
+        ImmutableList<LoggingEvent> loggingEvents = TEST_LOGGER.getLoggingEvents();
+        assertThat(loggingEvents.size()).isGreaterThan(0);
+
+        LoggingEvent event = loggingEvents.get(0);
+        assertThat(event.getMessage()).isEqualTo("Unable to correctly evaluate flag with key '{}'");
+        assertThat(event.getThrowable().isPresent()).isTrue();
+        assertThat(event.getThrowable().get()).isInstanceOf(FlagNotFoundError.class);
     }
 
     @Specification(number="1.2.2", text="The client interface MUST define a metadata member or accessor, containing an immutable name field or accessor of type string, which corresponds to the name value supplied during client creation.")