Hi,
I heard that there was a utility for keeping files and specifically
log files organized, but haven't been able to find anything but the
logging class. The logging class seems to help create the content of a
log file, but unless I am missing something, it doesn't keep track of
multiple log files.
What I am looking for is some utility that allows me to create a log
file, say test.log, when the program runs. Then the next time it runs
it will see that test.log already exists and will create test.log.1 or
something similiar. Ideally it would also be able to throw out log
files that are older than a certain date or sequence, so if we got to
creating the 10th file it would delete the first one and so on.
I am sorry for the ambiguois question, but I was told this existed,
can't find it and would like to know if I'm on a wild goose chase and
should just put something together myself.
Thank you,
Nik 3 1047
On Oct 23, 11:46 am, nik <nikb...@gmail.comwrote:
Hi,
I heard that there was a utility for keeping files and specifically
log files organized, but haven't been able to find anything but the
logging class. The logging class seems to help create the content of a
log file, but unless I am missing something, it doesn't keep track of
multiple log files.
What I am looking for is some utility that allows me to create a log
file, say test.log, when the program runs. Then the next time it runs
it will see that test.log already exists and will create test.log.1 or
something similiar. Ideally it would also be able to throw out log
files that are older than a certain date or sequence, so if we got to
creating the 10th file it would delete the first one and so on.
I am sorry for the ambiguois question, but I was told this existed,
can't find it and would like to know if I'm on a wild goose chase and
should just put something together myself.
Thank you,
Nik
I think it is called "logfile rotation" and see some links about
log4py, but no description of what that is.
thanks
En Tue, 23 Oct 2007 17:08:03 -0300, nik <ni*****@gmail.comescribió:
I think it is called "logfile rotation" and see some links about
log4py, but no description of what that is.
See the logging package; in particular, you want a RotatingFileHandler.
<http://docs.python.org/lib/module-logging.html>
--
Gabriel Genellina
OK, that's it,
so to do what I want I am using:
self.logger = logging.getLogger('debuglog')
hdlr = logging.handlers.RotatingFileHandler(debugfilename ,
'a', 0, 5)
hdlr.doRollover()
formatter = logging.Formatter('%(asctime)s %
(levelname)s: %(message)s')
hdlr.setFormatter(formatter)
self.logger.addHandler(hdlr)
Thanks for your help This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dan Greenblatt |
last post by:
I am writing some software that, among other things, needs to track
the state of database tables. This includes occasionally checking the
table to see what records or added, modified, or deleted....
|
by: Skeleton Man |
last post by:
Hi,
I have a chat script which I added very basic bandwidth tracking to as follows:
ob_start();
print "this is some output!";
print "this is more output!";
$bytes = ob_get_length(); //...
|
by: D. Dante Lorenso |
last post by:
First I created a function that selected the next available pin
code from a table of pre-defined pin codes:
CREATE FUNCTION "public"."get_next_pin_code" () RETURNS varchar AS'
DECLARE...
|
by: Ryan |
last post by:
My project uses the /ORDER specifier to order functions as specified in file containing the decorated names of packaged functions (COMDATs). I am in the process of upgrading from VC6 to VC.NET 2003....
|
by: Muddassir |
last post by:
hi everybody
I am writing an application for tracking files and directory changes
I used
FindFirstChangeNotification
FindNextChangeNotification
FindCloseChangeNotification...
|
by: moogyd |
last post by:
Hi,
(Off-topic)
I am looking to put an open-source bug/issue tracking system in place
for our current project (eventually expanded for all projects), and
would appreciate any...
|
by: =?Utf-8?B?R3JhaGFt?= |
last post by:
I've added 2 tracking services to the wf runtime; one is the standard
SqlTrackingService:
trackingService = new
SqlTrackingService(<trackingConnectionString>);
<workflow...
|
by: LiveTecs |
last post by:
http://www.livetecs.com
TimeLive Web Collaboration Suite is an integrated suite that allows you to
manage project life cycle including tasks, issues, bugs, timesheet, expense,
attendance.
...
|
by: =?Utf-8?B?THVjYXM=?= |
last post by:
Does anyone know what solution Microsoft offers for network file tracking? I
am looking for a solution that allows me to cut down on wasted network volume
space. We have a large number of old...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |