I want to add a blank line after my LOG
statement in order to make my logs more separated and readable.
How do I do this?
Current statement:
LOGGER.info("Person's name is {} .", person.getName());
Note that I don't want to do this after every statement, just for certain statements.
Simply add \n
at the end of the string to log.
LOGGER.info("Person's name is {} .\n", person.getName());
If you are in a windows environment use \r\n
To get the right value of new line if you don't know the end operating system of your application you can use the property line.separator
String lineSeparator = System.getProperty("line.separator");
LOGGER.info("Person's name is {} .{}", person.getName(), lineSeparator);