Re: Log4J

Posted by rmetzger0 on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Log4J-tp11652p11669.html

I've also (successfully) tried running Flink with log4j2 to connect it to greylog2. If I remember correctly, the biggest problem was "injecting" the log4j2 properties file into the classpath (when running Flink on YARN).

Maybe you need to put the file into the lib/ folder, so that it is shipped to all the nodes, and then loaded from the classpath (there is a special name in the log4j2 documentation. If you use that name, it'll be loaded from the classloader)

If you are running in standalone mode, you can just modify the scripts to point the JVMs to the right config file.

On Thu, Feb 16, 2017 at 11:54 AM, Stephan Ewen <[hidden email]> wrote:
Hi!

The bundled log4j version (1.x) does not support that.

But you can replace the logging jars with those of a different framework (like log4j 2.x), which supports changing the configuration without stopping the application.
You don't need to rebuild flink, simply replace two jars in the "lib" folder (and update the config file, because log4j 2.x has a different config format).

This guide shows how to swap log4j 1.x for logback, and you should be able to swap in log4j 2.x in the exact same way.



On Thu, Feb 16, 2017 at 5:20 AM, Chet Masterson <[hidden email]> wrote:
Is there a way to reload a log4j.properties file without stopping and starting the job server?