I am doing data analysis using hadoop using java on eclipse ,I am get my output log as shown in the below image on eclipse, how can we redirect it to a text area..

I am doing data analysis using hadoop using java on eclipse ,I am get my output log as shown in the below image on eclipse, how can we redirect it to a text area..

Try this:
public class JTextAreaOutputStream extends OutputStream {
private JTextArea destination;
public JTextAreaOutputStream(JTextArea destination) {
if (destination == null)
throw new IllegalArgumentException ("Destination is null");
this.destination = destination;
}
@Override
public void write(int b) throws IOException {
write (new byte [] {(byte)b}, 0, 1);
}
@Override
public void write(byte[] buffer, int offset, int length) throws IOException
{
final String text = new String (buffer, offset, length);
SwingUtilities.invokeLater(new Runnable ()
{
@Override
public void run()
{
destination.append (text);
}
});
}
}
Then Redirect you text area like this:
public void setSystemOutRedirect() {
JTextAreaOutputStream out = new JTextAreaOutputStream (textAreaUpgraderLog);
System.setOut (new PrintStream(out));
System.setErr(new PrintStream(out));
}
Just use the following snippet at the beginning of your program.
File file = new File("D:/out.txt");
FileOutputStream fos = new FileOutputStream(file);
PrintStream ps = new PrintStream(fos);
System.setErr(ps);
then all Standard err will be redirected to D:/out.txt file.
For redirecting standard output just use System.setOut(ps)
These are mostly counters and progress so, have a look at this post and JobClient's API.
Also, I think you will find this post very useful.