Change log level from DEBUG to INFO for ObservationHandlers
The features are disabled by default and users need to explicitly enable them. Probably it makes more sense to log on INFO level so that users don't need to change the log level if they use the default behavior of Spring Boot. See gh-3003 See gh-3127
This commit is contained in:
committed by
Christian Tzolov
parent
5d6bbd9368
commit
cd3fc2f816
@@ -40,7 +40,7 @@ public class ChatClientPromptContentObservationHandler implements ObservationHan
|
||||
|
||||
@Override
|
||||
public void onStop(ChatClientObservationContext context) {
|
||||
logger.debug("Chat Client Prompt Content:\n{}", ObservabilityHelper.concatenateEntries(processPrompt(context)));
|
||||
logger.info("Chat Client Prompt Content:\n{}", ObservabilityHelper.concatenateEntries(processPrompt(context)));
|
||||
}
|
||||
|
||||
private Map<String, Object> processPrompt(ChatClientObservationContext context) {
|
||||
|
||||
@@ -63,7 +63,7 @@ class ChatClientPromptContentObservationHandlerTests {
|
||||
.build();
|
||||
this.observationHandler.onStop(context);
|
||||
assertThat(output).contains("""
|
||||
Chat Client Prompt Content:
|
||||
INFO o.s.a.c.c.o.ChatClientPromptContentObservationHandler -- Chat Client Prompt Content:
|
||||
[]
|
||||
""");
|
||||
}
|
||||
@@ -75,7 +75,7 @@ class ChatClientPromptContentObservationHandlerTests {
|
||||
.build();
|
||||
this.observationHandler.onStop(context);
|
||||
assertThat(output).contains("""
|
||||
Chat Client Prompt Content:
|
||||
INFO o.s.a.c.c.o.ChatClientPromptContentObservationHandler -- Chat Client Prompt Content:
|
||||
["user":"supercalifragilisticexpialidocious"]
|
||||
""");
|
||||
}
|
||||
@@ -90,7 +90,7 @@ class ChatClientPromptContentObservationHandlerTests {
|
||||
.build();
|
||||
this.observationHandler.onStop(context);
|
||||
assertThat(output).contains("""
|
||||
Chat Client Prompt Content:
|
||||
INFO o.s.a.c.c.o.ChatClientPromptContentObservationHandler -- Chat Client Prompt Content:
|
||||
["system":"you're a chimney sweep", "user":"supercalifragilisticexpialidocious"]
|
||||
""");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user