Logging with slf4j

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

Logging with slf4j

simon peyer
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
Reply | Threaded
Open this post in threaded view
|

Re: Logging with slf4j

stefanobaghino
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Logging with slf4j

simon peyer
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 <[hidden email]> 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 <[hidden email]> 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


log4j-cli.properties (2K) Download Attachment
log4j-yarn-session.properties (1K) Download Attachment
log4j.properties (1K) Download Attachment
logback-yarn.xml (1K) Download Attachment
logback.xml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Logging with slf4j

Stephan Ewen
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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