This discussion is archived
10 Replies Latest reply: May 31, 2011 9:51 AM by 796440 RSS

Suggestions regarding echoing logs to consol instantly.

864321 Newbie
Currently Being Moderated
Hi,

I am working on a console application much like a shell. The situation is briefly like this.

1. User is presented a prompt.
2. User types a command on shell.
3. Shell looks up the appropriate command and invokes it.
4. STEP 1.

The individual commands when processing a user request might write info, exceptions etc to logger.
I want these to be echoed on the console BEFORE the prompt is presented to the user again.

However, because of the delayed handling of log printing, the messages are sometimes printed after the prompt is presented. which looks very ugly.

Can this be achieved by some separate custom handler? or I will have to use separate SOUT's for echoing to console and turn off logger from spitting to console?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points