handle a log file.
Zunbeltz Izaola
zunbeltz at wm.lc.ehu.es.XXX
Fri Oct 8 09:12:07 EDT 2004
Peter L Hansen <peter at engcorp.com> writes:
> Zunbeltz Izaola wrote:
> > I've a GUI program (wxPython) that comunicates with a machine with UDP
> > sockets. Every sended socket is writted to file for inspection if
> > there is problem. What ocurs is that sometimes the file grows to much
> > (32Mb) and the program has problems to manage it. Is any way to
> > control the size of the file?
>
> Use the standard logging module. It provides the capability for
> an automatically "rotating" log file which will handle rolling
> over and deleting/renaming the previous file automatically.
>
> You may need to write your own formatter, depending on the
> nature of your log entries...
> -Peter
Thanks to all for the response. I have use RotatingFileHandler and I
think it works smoothly.
Thaks for the point
Zunbetlz
--
Zunbeltz Izaola Azkona | wmbizazz at lg dot ehu
dotes
Materia Kondentsatuaren Fisika Saila |
Zientzia eta Teknologia Fakultatea | Phone: 34946015326
Euskal Herriko Unibertsitatea |
PK 644 | Fax: 34 944648500
48080 Bilbo (SPAIN) |
More information about the Python-list
mailing list