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 <se...@apache.org> 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.
>
> https://ci.apache.org/projects/flink/flink-docs-
> release-1.2/monitoring/best_practices.html#use-logback-
> when-running-flink-on-a-cluster
>
>
> On Thu, Feb 16, 2017 at 5:20 AM, Chet Masterson <chet.master...@yandex.com
> > wrote:
>
>> Is there a way to reload a log4j.properties file without stopping and
>> starting the job server?
>>
>
>

Reply via email to