You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Manish G <ma...@gmail.com> on 2020/07/20 13:27:57 UTC

Simple MDC logs don't show up

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

Re: Simple MDC logs don't show up

Posted by Fabian Hueske <fh...@gmail.com>.
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

[1]
https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/metrics.html


Am Mo., 20. Juli 2020 um 15:28 Uhr schrieb Manish G <
manish.c.ghildiyal@gmail.com>:

> 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
>
>