Now it's working particularly fine.
public class Errorlog
{
public static void main(String[] args)
{
System.out.println("This is output file");
System.err.println("This is an errorlog file");
}
}
After compiling and running the class file by giving the following command ,
java Errorlog>output.log 2>error.log
I get the following message in output.log
This is output file
error.log:
This is an errorlog file
But usually when I change the output message & error message content, these
messages often override the previous data in these files.
Consider now that I modify the class file as:
public class Errorlog
{
public static void main(String[] args)
{
System.out.println("New output");
System.err.println("New error ");
}
}
Now after compiling & running the class file by giving these command
java Errorlog>output.log 2>error.log
The content in output.log is:
New output
Clearly it had overridden the previous message:"
This is output file"
Same is the case in
error.log file also
I want the output.log to display:
This is output file
New output
How this can be done?
Regards.