B
bjhartin
All,
Does anyone know why text sent to stdout might intermittently get sent
to an open file? I have some code which writes data to a file and logs
its activity using log4j. On Friday, the log statements began to
intermittently appear in the file. I know the following things are
true:
* The code did not change
* The configuration did not change
* The log4j Logger is mapped only to a ConsoleAppender, i.e. log
statements are written only to stdout
* The name of the file is always unique
Here is the code:
//Create a unique filename for the order
filename = "Order " + orderId;
//Create the file
logger.info("Creating file " + fileName);
File file = new File(fileName);
FileWriter fw = new FileWriter(file);
logger.info("Writing File Content ");
fw.write(fileContent + System.getProperty("line.separator"));
logger.info("Closing File ");
fw.close();
It smells to me of an O/S or app server problem in which the file
handle for the open file is being provided for calls to stdout. Has
anyone ever seen this?
Thanks,
Brian
Does anyone know why text sent to stdout might intermittently get sent
to an open file? I have some code which writes data to a file and logs
its activity using log4j. On Friday, the log statements began to
intermittently appear in the file. I know the following things are
true:
* The code did not change
* The configuration did not change
* The log4j Logger is mapped only to a ConsoleAppender, i.e. log
statements are written only to stdout
* The name of the file is always unique
Here is the code:
//Create a unique filename for the order
filename = "Order " + orderId;
//Create the file
logger.info("Creating file " + fileName);
File file = new File(fileName);
FileWriter fw = new FileWriter(file);
logger.info("Writing File Content ");
fw.write(fileContent + System.getProperty("line.separator"));
logger.info("Closing File ");
fw.close();
It smells to me of an O/S or app server problem in which the file
handle for the open file is being provided for calls to stdout. Has
anyone ever seen this?
Thanks,
Brian