Simple MDC logs don't show up

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple MDC logs don't show up

Manish G
Hi All,

I have some very simple MDC logs in my flink job:

MDC.put("methodName", new Object() {}.getClass().getEnclosingMethod().getName());
MDC.put("className", this.getClass().getSimpleName());

When I run flink job locally, I can see them in the application logs.
But when I run the same job on kubernetes clutter, these don't show up.

Any input here?

With regards
Reply | Threaded
Open this post in threaded view
|

Re: Simple MDC logs don't show up

Fabian Hueske-2
Hi,

When running your code in the IDE, everything runs in the same local JVM.
When you run the job on Kubernetes, the situation is very different.
Your code runs in multiple JVM processes distributed in a cluster.

Flink provides a metrics collection system that you should use to collect metrics from the various processes.
Please have a look at the metrics documentation [1].

Best, Fabian



Am Mo., 20. Juli 2020 um 15:28 Uhr schrieb Manish G <[hidden email]>:
Hi All,

I have some very simple MDC logs in my flink job:

MDC.put("methodName", new Object() {}.getClass().getEnclosingMethod().getName());
MDC.put("className", this.getClass().getSimpleName());

When I run flink job locally, I can see them in the application logs.
But when I run the same job on kubernetes clutter, these don't show up.

Any input here?

With regards