Thanks. that does the job for me very well.<br><br><div class="gmail_quote">On Thu, Nov 5, 2009 at 7:18 PM,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 01:20 pm, <a href="mailto:namanvit@gmail.com">namanvit@gmail.com</a> wrote:<br>

&gt;I ll try to rephrase it better:<br>
&gt;<br>
&gt;I simply want the print statement to appear in both the log file and<br>
&gt;the<br>
&gt;console.<br>
&gt;print(&quot;goes in both&quot;) -&gt; the log also gets this and the console also.<br>
&gt;<br>
&gt;Thanks<br>
<br>
</div>How about installing two log observers?<br>
<br>
    from sys import stdout<br>
    from twisted.python.log import FileLogObserver, startLogging,<br>
addObserver, msg<br>
<br>
    # First, startLogging to capture stdout<br>
    startLogging(stdout)<br>
<br>
    # Now add an observer that logs to a file<br>
    addObserver(FileLogObserver(file(&quot;foo.log&quot;)).emit)<br>
<br>
    msg(&quot;Hello, world&quot;)<br>
    print &quot;Goodbye, world&quot;<br>
<div><div></div><div class="h5"><br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>