VASmalltalk – log4s – Transcript appender

When working under Windows you may notice – if activating log4s and you defined it – that a Transcript appender has been created for the main logger (the “root” logger) – but you will not see any output from that appender. The reason is simple: the appender points to TranscriptTTY – and not Transcript – and therefore the outputs are more or less lost. The appender behaves more like an EsConsoleAppender.

With the following one-line you may correct the current instance of the appender to do the output to Transcript:

| tAppender |
(tAppender := EsLogManager rootLogger 
                getAppender: 'Transcript') notNil 
  ifTrue:[ tAppender stream: Transcript ]

I think, that at that time, where the initialization is done, only TranscriptTTY is available and Transcript points to TranscriptTTY at those time. The new instance of the appender copies the content of Transcript at initialization time and that was: TransciptTTY.

You may also fix the code quickly by adding the following method to EsTranscriptAppender:

EsTranscriptAppender>>append: aLoggingEvent
   nextPutAll: (layout format: aLoggingEvent);
This entry was posted in Smalltalk and tagged , , . Bookmark the permalink.

1 Response to VASmalltalk – log4s – Transcript appender

  1. Pingback: VASmalltalk – log4s and its design failures | Schrievkrom

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.