How to Log with Logfeeder

1) Create the LogfeederSample.java file:

import java.util.logging.Logger;

public final class LogfeederSample{

  public static void main(final String[] args) {
    final Logger logger = Logger.getLogger(LogfeederSample.class.getName());

    logger.info("Hello World!");
  }

}

2) Create the logging.properties file:

java.util.logging.SocketHandler.host=localhost
java.util.logging.SocketHandler.port=4446 # no default

LogfeederSample.handlers=java.util.logging.SocketHandler

3) Compile the LogfeederSample.java file.

4) Launch Logfeeder.

5) Launch the LogfeederSample class.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s