• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logger & carriage return  RSS feed

 
Stefan Gerber
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I log some information with the java.util.logging.Logger. When i open the file with the windows notepad than all log entries are on the same line.
Are there any settings where i can set at the logger that after each line a carriage return will be inserted?

thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also try using a real editor, but the EOL character is a Java system property.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Notepad is indeed a very bad text editor. It only recognizes the \r\n (carriage return / line feed) combination as line breaks. All others (\r or \n separately) will be shown as little blocks. Just about any other text editor is better.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A very good, popular and free editor (for Windows only) is Notepad++.
 
Stefan Gerber
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Thanks for the answers
I know it is a bad editor. But when you are trying to reproduce some bug on a customer computer than you can't install an other editor. Notepad is normally installed on all computers. So it is the simplest way to check the logfile.

So what are the influences when i set the java property to EOL? Is it not possible to set it just for the logger?

thanks
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can install many editors on a USB stick instead.

You can replace the line break by calling
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!