473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

tracking/ordering log files

nik
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

Oct 23 '07 #1
3 1049
nik
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

Oct 23 '07 #2
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

Oct 24 '07 #3
nik
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
Nov 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
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....
1
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(); //...
2
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...
3
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....
1
by: Muddassir | last post by:
hi everybody I am writing an application for tracking files and directory changes I used FindFirstChangeNotification FindNextChangeNotification FindCloseChangeNotification...
4
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...
3
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...
0
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. ...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.