| Author |
How to make each log entry start on a new line?
|
Ong CherYee
Greenhorn
Joined: Jan 17, 2008
Posts: 10
|
|
am doing java logging to file using the logger class. In order to write logs to the file, a file handler was created using the 'append' mode. However, when the log entries are written to the log file, they are all entered on a single line. How do I make each new log entry start on a new line?
|
 |
Sunny Jain
Ranch Hand
Joined: Jul 23, 2007
Posts: 433
|
|
Try to append the following at the end of line: "\n" or "\r\n"
|
Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Better yet, use System.getProperty("line.separator"). That will use the platform dependant line separator - \n for Unix, \r\n for Windows, etc.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: How to make each log entry start on a new line?
|
|
|