We are trying to understand how PrintStream works when used for logging. There are several examples over the internet but we need to understand how that writes data in a text file. Here is the example:
ps = new PrintStream(fos);
Let's say we have that piece of logging in a web application and that application is used frequently, how will it work? Does it open and close the text file every time the example code is repeated?