One fine day, OOM (i love this term) Out Of Memory occured. This application has been migrated to tomcat and we disabled catalina.out by redirecting output to /dev/null. This is because catalina.out file started growing in GBs. Now how do we debug OOM, there is no out file :(
Here is where, we realised sysout issue. What a mistake, we should have used logger for this. Anyway how to solve? We discussed couple of options, writing a custom pearl script to comment out set of files. Take it as a manual tasks.
Luckily Eclipse has option to search and replace multiple files
- Check out all the files from repository
- Setup java project for application
- Select Search > File option
- Enter System.out.print as containing text
- File name patterns as “*”
- Click on Replace
- Enter "Logger.debug" as replace String
- Select replace all to replace in all files
- Update to repository and commit
No comments:
Post a Comment