There are lot of libraries out there like log4j, which you can integrate with your app for easier log management. Log4j/log4net have the provision to either log the information to a file or send email.
So, will it be helpful if you can directly see the logs in Eclipse that will get updated whenever the log file gets updated ?
Using NTail, you can achieve this. The content of the log file will be shown in a window inside Eclipse which will automatically get updated.
- Download latest version of NTail from the website http://www.certiv.net/downloads/ntaildownload.html.
- Now copy the .jar file to the 'Plugins' directory inside the Eclipse installation folder.
- Open Eclipse
- Go to Window -> Preferences.
- In the Preferences window you can see the 'NTail' section (If NTail is not listed there, your version of Eclipse may not have support for the version of NTail).
- Expand the NTail section and select 'Define Viewers'.
- Click 'New' and give the details of the log file and a name.
- Click 'OK' and you have successfully setup the NTail to watch a file for changes.
- Now, go to Window -> Show View -> Other.
- Select NTail from Logging -> NTail. Alternatively, you can type 'NTail' in the filter text box on top of the window.
- Click 'OK'.
- The NTail window should open inside your Eclipse.
Now, whenever the file gets changed, it will be shown inside the NTail window.