0

LOG4J seems to lock my consoleappender. If my consoleappender is locked by LOG4J, would also succeeding threads have a hard time writing to my stout and stderr?

How many threads at a time can write to the stdout?

Thanks

grassbl8d
  • 2,089
  • 4
  • 24
  • 34
  • I've never seen log4j be blocked / locked by anything. What is making you think it's at fault? – Brian Oct 24 '11 at 16:10
  • What is your consoleappender writing to? A shell, Eclipse, a windows command shell, a file (via a redirection)? – Matthew Farwell Oct 24 '11 at 22:13
  • See http://stackoverflow.com/a/634147/603516. Console output must be consumed or it would eventually hang. – Vadzim Oct 30 '12 at 17:04

1 Answers1

0

Only one thread can write to sysout/syserr. This is actually good, otherwise your logging statements would get mixed terribly.

I don't think Log4J deadlocks on ConsoleAppender (stack dump would be very useful). Maybe you are logging too much and other threads are waiting, but eventually reach the console?

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674