Re: Getting a TimedRotatingFileHandler not to put two dates in thesame file?

Discussion in 'Python' started by Dave Angel, Oct 24, 2012.

  1. Dave Angel

    Dave Angel Guest

    On 10/23/2012 11:23 AM, David M Chess wrote:
    > We have a TimedRotatingFileHandler with when='midnight'


    You give us no clue what's in this class, or how it comes up with the
    filenames used.

    > .
    >
    > This works great, splitting the log information across files by date, as
    > long as the process is actually up at midnight.
    >
    > But now the users have noticed that if the process isn't up at midnight,
    > they can end up with lines from two (or I guess potentially more) dates in
    > the same log file.
    >
    > Is there some way to fix this, either with cleverer arguments into the
    > TimedRotatingFileHandler, or by some plausible subclassing of it or its
    > superclass?


    Why not use the date itself to derive the filename? And check whether
    the date has changed since the last update, and if so, close and
    reopen. Midnight is irrelevant.

    > Or am I misinterpreting the symptoms somehow?
    >
    > Tx much!
    > DC
    >
    >


    --

    DaveA
    Dave Angel, Oct 24, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi

    Dates dates dates dates... SQL and ASP.NET

    David Lozzi, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    830
    Rob Schieber
    Sep 30, 2005
  2. Chris Shenton
    Replies:
    4
    Views:
    3,750
    Vinay Sajip
    Feb 23, 2007
  3. PW

    Dates! Dates! Dates!

    PW, Aug 7, 2004, in forum: ASP General
    Replies:
    4
    Views:
    166
    Mark Schupp
    Aug 9, 2004
  4. laredotornado
    Replies:
    1
    Views:
    66
    Rick DeNatale
    Jan 28, 2008
  5. Vinay Sajip
    Replies:
    0
    Views:
    223
    Vinay Sajip
    Oct 24, 2012
Loading...

Share This Page