<div dir="ltr">On Wed, Oct 16, 2013 at 12:33 PM, Conor Sayres <span dir="ltr"><<a href="mailto:sayresc@gmail.com" target="_blank">sayresc@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I'm working for an astro observatory and we are upgrading our telescope control software.  We are swapping to twisted under the hood, and I have run into an issue regarding logging.<br>
<br>
I have set up twisted logging to record all communication between our devices.  When we simulate our system with a high frequency log rollover rate (~5 seconds), many of the logs contain only garbage.  Here is an example of a few lines in a given bad log file:<br>

<br>
3230 3133 2d31 302d 3136 2031 303a 3131<br>
3a34 352d 3037 3030 205b 2d5d 2044 6576<br>
436d 6428 5354 4154 5553 290a 3230 3133<br>
2d31 302d 3136 2031 303a 3131 3a34 352d<br>
3037 3030 205b 2d5d 2044 6576 436d 6428<br>
5354 4154 5553 290a 3230 3133 2d31 302d<br>
<br>
Here is an example of a few lines from a good log file:<br>
<br>
2013-10-16 10:11:39-0700 [_SocketProtocol,client] Galil Reply(XQ#STATUS)<br>
2013-10-16 10:11:39-0700 [-] Galil Reply(: 1,  1,  1,  1,  1 axis homed)<br>
2013-10-16 10:11:39-0700 [-] To All Users(1 1 i axisHomed=1, 1, 1, 1, 1)<br>
2013-10-16 10:11:39-0700 [-] Galil Reply(000000000, 000000000, 000000000, 000000000, 000000000 commanded position)<br>
2013-10-16 10:11:39-0700 [-] To All Users(1 1 i cmdMount=0, 0, 0, 0, 0)<br>
2013-10-16 10:11:39-0700 [_SocketProtocol,client] MirrorCtrl Reply(1 1 i axisHomed=1, 1, 1, 1, 1)<br>
2013-10-16 10:11:39-0700 [_SocketProtocol,client] Galil Reply(XQ#STATUS)<br>
<br>
I haven't been able to reproduce the problem in a simpler framework than our simulation.  I am triggering the rollover by directly calling LogFile.rollover on a timer.  The problem also exists if I define a small file size limit for automatic rollover and let twisted do it automatically.<br>
</blockquote><div><br></div><div><br></div><div>I don't think there's any method named "rollover" anywhere in Twisted (in fact, I just confirmed this with grep).</div><div><br></div><div>Your message is pretty vague and context-free; could you try to add more necessary detail? Is the problem with the output you're seeing the *content* of the numbers/letters, or just the fact that they're appearing at all? Maybe there's relevant output before or after that block of numbers/letters? Did you leave out the timestamp prefixes when pasting to this email, or is there really no timestamp prefixing the lines of that output?</div>
<div><br></div><div>I don't know where those numbers/letters could be coming from. Does your code (or any libraries you use) ever print to stdout? By default, Twisted redirects all prints (and any writing to sys.stdout) to the log file.</div>
<div><br></div><div><br></div></div>-- <br>Christopher Armstrong<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://planet-if.com/">http://planet-if.com/</a><br><br>
</div></div>