4

Running a Spring-Boot 1.4 app unit test with JUnit 4, (logging via SLF4J and Log4j 2.x), my output window begins:

SYSTEM_OUTPUT/Library/Java/JavaVirtualMachines/jdk1.8/Contents/Home/bin/java -ea -Didea.launcher.port=7534

and then every line after that ends with "NORMAL_OUTPUT", à la:

14:48:36.135 DEBUG [main] org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]NORMAL_OUTPUT

It's just an irritation, but it would be nice to be rid of it.

I'm 98% sure this wasn't happening prior to 2016.3 (I'm using the "Ultimate" edition).

(BTW: the "NORMAL_OUTPUT" and "SYSTEM_OUTPUT" tokens do not appear in the on-disk log file, which tells me it's not due to log4j 2.x. SLF4J's jcl-over-slf4j jar is in the path, to capture Spring's logging. No change in version for any of those.)

LarryW
  • 121
  • 1
  • 6

1 Answers1

0

I suspect it might have to do with the pattern layout that was configured.

I originally had this and it was putting a new line and space at the beginning of each line (because of %n%throwable), the IDE's formatting probably couldn't make sense of the formatting instructions.

<PatternLayout pattern="%highlight{%d [%t] %notEmpty{[%marker] }%-5level: %msg%n%throwable}"/>

I then changed it to this and it was better:

<PatternLayout pattern="%highlight{%d [%t] %notEmpty{[%marker] }%-5level: %msg%notEmpty{%throwable}}%n"/>
Luke Machowski
  • 3,983
  • 2
  • 31
  • 28