Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have difficulties with session logging and Mathematica 10. In previous versions, you could simply use AppendTo[$Echo, logfile] and AppendTo[$Output, logfile].

In Mathematica 10, appending to $Echo only works for cells in raw input format, as stated in the reference.

Appending to $Output seems not working. Log file is always empty.

My questions:

a) How can I force all input cells to be in "raw input format", without converting the cells by the menu?

b) What's wrong with my AppendTo[$Output]?

oldout = $Output;
logfile = OpenWrite[FileNameJoin[{$TemporaryDirectory, "math.log"}],
    FormatType -> InputForm];
AppendTo[$Output, logfile];
AppendTo[$Echo, logfile];

(* tests, $Echo works, if cell is converted to raw input format *)
Expand[(a + b)^3]
Factor[z^5 - 1]
N[Pi, 24]
$Output = oldout;
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.