This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

$Messages

$Messages
gives the list of files and pipes to which message output is sent.
The default channel for messages is standard output:
Have messages go to a temporary file and the default channel:
Generate a message:
Show the contents of the temporary file:
Clean up by resetting $Messages to its default and closing the stream:
The default channel for messages is standard output:
In[1]:=
Click for copyable input
Out[1]=
 
Have messages go to a temporary file and the default channel:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Generate a message:
In[3]:=
Click for copyable input
Out[3]=
Show the contents of the temporary file:
Clean up by resetting $Messages to its default and closing the stream:
In[5]:=
Click for copyable input
Out[5]=
New in 1