Login  Register

Simple MDC logs don't show up

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

Simple MDC logs don't show up

Manish G
42 posts
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
| More
Print post
Permalink

Re: Simple MDC logs don't show up

Fabian Hueske-2
1749 posts
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