Endorsed lib in Flink

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

Endorsed lib in Flink

chiggi_dev
Hi,

Is there some sort of endorsed lib in Flink yet?

A brief about my use case :

I am using a 3PP in my job which uses SLF4J as logging facade but has included a log4j1 binding in its source code. And I am trying to use log4j2 for my Flink application.

I wired Flink to use log4j2 - added all dependencies, Updated the conf to include the log4j2.properties etc.

But since the 3PP uses log4j1 in such a coupled manner, it always uses that for logging. 

My solution was to use an endorsed directory by forcing Flink to read the log4j2 binding before the 3PP and it works fine.

Now, I am not sure about the maintainability of such a tweak. Any update in the Flink startup scripts will break this workaround. 

Clearly, I need a cleaner alternative. 

Any leads on this? 

Thanks ,

Chirag

Reply | Threaded
Open this post in threaded view
|

Re: Endorsed lib in Flink

Till Rohrmann
Hi Chirag,

have you tried excluding the log4j1 jars and adding the log4j 1.2 bridge [1] so that all logging goes through log4j2?


Cheers,
Till

On Tue, Feb 5, 2019 at 1:04 PM Chirag Dewan <[hidden email]> wrote:
Hi,

Is there some sort of endorsed lib in Flink yet?

A brief about my use case :

I am using a 3PP in my job which uses SLF4J as logging facade but has included a log4j1 binding in its source code. And I am trying to use log4j2 for my Flink application.

I wired Flink to use log4j2 - added all dependencies, Updated the conf to include the log4j2.properties etc.

But since the 3PP uses log4j1 in such a coupled manner, it always uses that for logging. 

My solution was to use an endorsed directory by forcing Flink to read the log4j2 binding before the 3PP and it works fine.

Now, I am not sure about the maintainability of such a tweak. Any update in the Flink startup scripts will break this workaround. 

Clearly, I need a cleaner alternative. 

Any leads on this? 

Thanks ,

Chirag