Send All Your System Messages To File

Often, while developing a system you want to debug it using System.out.println or System.err.println. When development is over you would like to send all those messages to file. The easiest way to do this is to assign System.out and System.err to corresponding files. Here is the code:

 public class MyClass{    static    {        try {            PrintWriter errOut = new PrintWriter(newFileWrier(

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: