You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by simon peyer <si...@soom-it.ch> on 2016/05/25 13:58:08 UTC

Logging with slf4j

Hi guys

Trying to log stuff, I used the print/println function which works quite well.
But now I would like to use the slf4j logger.
For each class/object in scala I intiliaized a logger like this:
 var log: Logger = LoggerFactory.getLogger(getClass)

then I did some logging log.error("Error....")

But it doesn't show on the console.
After reading a lot of websides about this issue I was not able to come to a solution.

Do you guys have any ideas how to integrate the sl4fj logger into scala flink?

--Thanks 
Simon

Re: Logging with slf4j

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

If the loggers are configured to log to files, all your output will show up
in the ".log" files in the "log" directory.
If the loggers are configured to log to console, all your output will show
up in the ".out" files in the "log" directory.

There is no functionality built in to take log output and transfer it to
the submitting client's console.

Greetings,
Stephan





On Thu, May 26, 2016 at 11:36 AM, simon peyer <si...@soom-it.ch>
wrote:

> Hi
>
> I'm using log4j, running localy in cluster mode, with sh start_cluster.sh
> No warnings in the command line.
>
> Please find attached the Logging Files.
>
> Where are I'm supposed to find the logging information?
> In the log directory right?
>
> Cheers Simon
>
>
>
>
>
>
>
>
>
> On 25 May 2016, at 16:10, Stefano Baghino <st...@radicalbit.io>
> wrote:
>
> It looks like the logs should show up.
> Are you using log4j or logback? Did you include the binding to slf4j for
> the library you're using? Did any warning on slf4j appear on stdout when
> the job is run? If you set up all correctly, can you share your
> logback/log4j config file with us so that we can maybe understand the
> problem?
>
> On Wed, May 25, 2016 at 3:58 PM, simon peyer <si...@soom-it.ch>
> wrote:
>
>> Hi guys
>>
>> Trying to log stuff, I used the print/println function which works quite
>> well.
>> But now I would like to use the slf4j logger.
>> For each class/object in scala I intiliaized a logger like this:
>>  var log: Logger = LoggerFactory.getLogger(getClass)
>>
>> then I did some logging log.error("Error....")
>>
>> But it doesn't show on the console.
>> After reading a lot of websides about this issue I was not able to come
>> to a solution.
>>
>> Do you guys have any ideas how to integrate the sl4fj logger into scala
>> flink?
>>
>> --Thanks
>> Simon
>>
>
>
>
> --
> BR,
> Stefano Baghino
>
> Software Engineer @ Radicalbit
>
>
>
>

Re: Logging with slf4j

Posted by simon peyer <si...@soom-it.ch>.
Hi 

I'm using log4j, running localy in cluster mode, with sh start_cluster.sh
No warnings in the command line.

Please find attached the Logging Files.

Where are I'm supposed to find the logging information?
In the log directory right?

Cheers Simon





> On 25 May 2016, at 16:10, Stefano Baghino <st...@radicalbit.io> wrote:
> 
> It looks like the logs should show up.
> Are you using log4j or logback? Did you include the binding to slf4j for the library you're using? Did any warning on slf4j appear on stdout when the job is run? If you set up all correctly, can you share your logback/log4j config file with us so that we can maybe understand the problem?
> 
> On Wed, May 25, 2016 at 3:58 PM, simon peyer <simon.peyer@soom-it.ch <ma...@soom-it.ch>> wrote:
> Hi guys
> 
> Trying to log stuff, I used the print/println function which works quite well.
> But now I would like to use the slf4j logger.
> For each class/object in scala I intiliaized a logger like this:
>  var log: Logger = LoggerFactory.getLogger(getClass)
> 
> then I did some logging log.error("Error....")
> 
> But it doesn't show on the console.
> After reading a lot of websides about this issue I was not able to come to a solution.
> 
> Do you guys have any ideas how to integrate the sl4fj logger into scala flink?
> 
> --Thanks 
> Simon
> 
> 
> 
> -- 
> BR,
> Stefano Baghino
> 
> Software Engineer @ Radicalbit


Re: Logging with slf4j

Posted by Stefano Baghino <st...@radicalbit.io>.
It looks like the logs should show up.
Are you using log4j or logback? Did you include the binding to slf4j for
the library you're using? Did any warning on slf4j appear on stdout when
the job is run? If you set up all correctly, can you share your
logback/log4j config file with us so that we can maybe understand the
problem?

On Wed, May 25, 2016 at 3:58 PM, simon peyer <si...@soom-it.ch> wrote:

> Hi guys
>
> Trying to log stuff, I used the print/println function which works quite
> well.
> But now I would like to use the slf4j logger.
> For each class/object in scala I intiliaized a logger like this:
>  var log: Logger = LoggerFactory.getLogger(getClass)
>
> then I did some logging log.error("Error....")
>
> But it doesn't show on the console.
> After reading a lot of websides about this issue I was not able to come to
> a solution.
>
> Do you guys have any ideas how to integrate the sl4fj logger into scala
> flink?
>
> --Thanks
> Simon
>



-- 
BR,
Stefano Baghino

Software Engineer @ Radicalbit