Skip to content

Commit 54e8209

Browse files
vidyadharamurthyjkwatsonbreedx-splk
authored
Changing the log levels in error scenarios (#6832)
Co-authored-by: John Watson <[email protected]> Co-authored-by: jason plumb <[email protected]>
1 parent eb2b668 commit 54e8209

File tree

1 file changed

+4
-3
lines changed
  • opentracing-shim/src/main/java/io/opentelemetry/opentracingshim

1 file changed

+4
-3
lines changed

opentracing-shim/src/main/java/io/opentelemetry/opentracingshim/TracerShim.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ public SpanBuilder buildSpan(String operationName) {
8080
@Override
8181
public <C> void inject(SpanContext context, Format<C> format, C carrier) {
8282
if (context == null) {
83-
logger.log(Level.INFO, "Cannot inject a null span context.");
83+
logger.log(Level.WARNING, "Cannot inject a null span context.");
8484
return;
8585
}
8686

8787
SpanContextShim contextShim = ShimUtil.getContextShim(context);
8888
if (contextShim == null) {
89+
logger.log(Level.WARNING, "Cannot inject a null span context shim.");
8990
return;
9091
}
9192

@@ -107,7 +108,7 @@ public <C> SpanContext extract(Format<C> format, C carrier) {
107108
}
108109
} catch (RuntimeException e) {
109110
logger.log(
110-
Level.INFO,
111+
Level.WARNING,
111112
"Exception caught while extracting span context; returning null. "
112113
+ "Exception: [{0}] Message: [{1}]",
113114
new String[] {e.getClass().getName(), e.getMessage()});
@@ -127,7 +128,7 @@ public void close() {
127128
try {
128129
((Closeable) provider).close();
129130
} catch (RuntimeException | IOException e) {
130-
logger.log(Level.INFO, "Exception caught while closing TracerProvider.", e);
131+
logger.log(Level.WARNING, "Exception caught while closing TracerProvider.", e);
131132
}
132133
}
133134
}

0 commit comments

Comments
 (0)