You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Attila Bernáth <be...@gmail.com> on 2014/11/06 17:31:44 UTC

how to specify the log level?

Dear Developers!

I clone the incubator-flink from github and import it as a maven
project in my eclipse.
I then run some example, like
org.apache.flink.spargel.java.examples.SpargelConnectedComponents
and I get a lot of log on the console. How to change that?
I tried changing some log4j.properties and logback.xml files,
according to the documentation, but I did not find the right one.
Thanks in advance.

Attila

Re: how to specify the log level?

Posted by Stephan Ewen <se...@apache.org>.
Hi!

How are you running your programs? Command line, IDE, web interface?


If you run programs from the command line (after building Flink, or
downloading a binary version), you should not get any log output, only
progress messages. These are not configurable by log, but you can pipe that
output away if it bothers you.
For the created log files, the log4j.properties in "conf" defines the
logging.


If you run examples or other programs from within the IDE, the system will
look for the log4j.properties in the classpath.

Greetings,
Stephan


On Fri, Nov 7, 2014 at 11:48 AM, Attila Bernáth <be...@gmail.com>
wrote:

> Dear Stephan,
>
> Assume I stand in the root directory of the incubator-flink repo.
>
> I did not find a log4j.properties file in that directory (I am not
> completely sure what you meant, I looked in
> flink-quickstart/flink-quickstart-java/src/main/resources
> )
> Putting an empty file there did not change anything.
>
> The log4j.properties files I have here are:
> sudocker@314a9613c340:~/git/incubator-flink$ find -name log4j.properties
>
> ./flink-dist/target/flink-0.7-incubating-SNAPSHOT-bin/flink-yarn-0.7-incubating-SNAPSHOT/conf/log4j.properties
>
> ./flink-dist/target/flink-0.7-incubating-SNAPSHOT-bin/flink-0.7-incubating-SNAPSHOT/conf/log4j.properties
>
> ./flink-dist/target/flink-0.8-incubating-SNAPSHOT-bin/flink-0.8-incubating-SNAPSHOT/conf/log4j.properties
> ./flink-dist/src/main/flink-bin/conf/log4j.properties
>
> All of these contain something like
> log4j.rootLogger=WARN, file
>
> Attila
>
>
> 2014-11-06 18:02 GMT+01:00 Stephan Ewen <se...@apache.org>:
> > Hi!
> >
> > If you use the quickstarts, you find a log4j.properties file in
> > src/main/resources. If you make this file empty, it will suppress the log
> > output.
> >
> > In general, a log4j.properties file in the classpath if the way to
> configure
> > logging.
> >
> > Stephan
> >
> >
> > On Thu, Nov 6, 2014 at 5:31 PM, Attila Bernáth <be...@gmail.com>
> > wrote:
> >>
> >> Dear Developers!
> >>
> >> I clone the incubator-flink from github and import it as a maven
> >> project in my eclipse.
> >> I then run some example, like
> >> org.apache.flink.spargel.java.examples.SpargelConnectedComponents
> >> and I get a lot of log on the console. How to change that?
> >> I tried changing some log4j.properties and logback.xml files,
> >> according to the documentation, but I did not find the right one.
> >> Thanks in advance.
> >>
> >> Attila
> >
> >
>

Re: how to specify the log level?

Posted by Till Rohrmann <ti...@gmail.com>.
Hi Attila,

if you want to reference a file outside of the jar, you usually have
to specify the complete URI with the "file:" schema. So try
-Dlog4j.configuration=file:/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties.
I hope this solves your problem.

Cheers,

Till

On Mon, Nov 10, 2014 at 11:10 AM, Attila Bernáth
<be...@gmail.com> wrote:
> Sorry to bother about this again: what do I miss here?
>
> If I also set the JVM argument (in eclipse
> Run/Configurations/Arguments/VM arguments):
> -Dlog4j.configuration="/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties"
> then I get the warning:
> ***************
> log4j:WARN No appenders could be found for logger
> (org.apache.flink.runtime.blob.BlobServer).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
> for more info.
> ***************
> The file contains one line:
> log4j.rootLogger=OFF
>
> Attila
>
>
>
> 2014-11-07 14:29 GMT+01:00 Attila Bernáth <be...@gmail.com>:
>> I have a solution.
>>
>>> Assume I stand in the root directory of the incubator-flink repo.
>>
>> mkdir flink-addons/flink-spargel/src/main/resources
>> cp ./flink-examples/flink-java-examples/src/main/resources/log4j.properties
>> flink-addons/flink-spargel/src/main/resources/
>>
>> (This file contains 1 line:
>> log4j.rootLogger=OFF
>> )
>>
>> This prevents any log outputs.
>>
>> However, if I also set the JVM argument (in eclipse
>> Run/Configurations/Arguments/VM arguments):
>> -Dlog4j.configuration="/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties"
>> then I get the warning:
>> log4j:WARN No appenders could be found for logger
>> (org.apache.flink.runtime.blob.BlobServer).
>> log4j:WARN Please initialize the log4j system properly.
>> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
>> for more info.
>>
>>
>> Attila

Re: how to specify the log level?

Posted by Attila Bernáth <be...@gmail.com>.
Sorry to bother about this again: what do I miss here?

If I also set the JVM argument (in eclipse
Run/Configurations/Arguments/VM arguments):
-Dlog4j.configuration="/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties"
then I get the warning:
***************
log4j:WARN No appenders could be found for logger
(org.apache.flink.runtime.blob.BlobServer).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
***************
The file contains one line:
log4j.rootLogger=OFF

Attila



2014-11-07 14:29 GMT+01:00 Attila Bernáth <be...@gmail.com>:
> I have a solution.
>
>> Assume I stand in the root directory of the incubator-flink repo.
>
> mkdir flink-addons/flink-spargel/src/main/resources
> cp ./flink-examples/flink-java-examples/src/main/resources/log4j.properties
> flink-addons/flink-spargel/src/main/resources/
>
> (This file contains 1 line:
> log4j.rootLogger=OFF
> )
>
> This prevents any log outputs.
>
> However, if I also set the JVM argument (in eclipse
> Run/Configurations/Arguments/VM arguments):
> -Dlog4j.configuration="/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties"
> then I get the warning:
> log4j:WARN No appenders could be found for logger
> (org.apache.flink.runtime.blob.BlobServer).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
> for more info.
>
>
> Attila

Re: how to specify the log level?

Posted by Attila Bernáth <be...@gmail.com>.
I have a solution.

> Assume I stand in the root directory of the incubator-flink repo.

mkdir flink-addons/flink-spargel/src/main/resources
cp ./flink-examples/flink-java-examples/src/main/resources/log4j.properties
flink-addons/flink-spargel/src/main/resources/

(This file contains 1 line:
log4j.rootLogger=OFF
)

This prevents any log outputs.

However, if I also set the JVM argument (in eclipse
Run/Configurations/Arguments/VM arguments):
-Dlog4j.configuration="/home/sudocker/git/incubator-flink/flink-addons/flink-spargel/src/main/resources/log4j.properties"
then I get the warning:
log4j:WARN No appenders could be found for logger
(org.apache.flink.runtime.blob.BlobServer).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.


Attila

Re: how to specify the log level?

Posted by Attila Bernáth <be...@gmail.com>.
Dear Stephan,

Assume I stand in the root directory of the incubator-flink repo.

I did not find a log4j.properties file in that directory (I am not
completely sure what you meant, I looked in
flink-quickstart/flink-quickstart-java/src/main/resources
)
Putting an empty file there did not change anything.

The log4j.properties files I have here are:
sudocker@314a9613c340:~/git/incubator-flink$ find -name log4j.properties
./flink-dist/target/flink-0.7-incubating-SNAPSHOT-bin/flink-yarn-0.7-incubating-SNAPSHOT/conf/log4j.properties
./flink-dist/target/flink-0.7-incubating-SNAPSHOT-bin/flink-0.7-incubating-SNAPSHOT/conf/log4j.properties
./flink-dist/target/flink-0.8-incubating-SNAPSHOT-bin/flink-0.8-incubating-SNAPSHOT/conf/log4j.properties
./flink-dist/src/main/flink-bin/conf/log4j.properties

All of these contain something like
log4j.rootLogger=WARN, file

Attila


2014-11-06 18:02 GMT+01:00 Stephan Ewen <se...@apache.org>:
> Hi!
>
> If you use the quickstarts, you find a log4j.properties file in
> src/main/resources. If you make this file empty, it will suppress the log
> output.
>
> In general, a log4j.properties file in the classpath if the way to configure
> logging.
>
> Stephan
>
>
> On Thu, Nov 6, 2014 at 5:31 PM, Attila Bernáth <be...@gmail.com>
> wrote:
>>
>> Dear Developers!
>>
>> I clone the incubator-flink from github and import it as a maven
>> project in my eclipse.
>> I then run some example, like
>> org.apache.flink.spargel.java.examples.SpargelConnectedComponents
>> and I get a lot of log on the console. How to change that?
>> I tried changing some log4j.properties and logback.xml files,
>> according to the documentation, but I did not find the right one.
>> Thanks in advance.
>>
>> Attila
>
>

Re: how to specify the log level?

Posted by Stephan Ewen <se...@apache.org>.
Hi!

If you use the quickstarts, you find a log4j.properties file in
src/main/resources. If you make this file empty, it will suppress the log
output.

In general, a log4j.properties file in the classpath if the way to
configure logging.

Stephan


On Thu, Nov 6, 2014 at 5:31 PM, Attila Bernáth <be...@gmail.com>
wrote:

> Dear Developers!
>
> I clone the incubator-flink from github and import it as a maven
> project in my eclipse.
> I then run some example, like
> org.apache.flink.spargel.java.examples.SpargelConnectedComponents
> and I get a lot of log on the console. How to change that?
> I tried changing some log4j.properties and logback.xml files,
> according to the documentation, but I did not find the right one.
> Thanks in advance.
>
> Attila
>