logger doesn't roll over

Discussion in 'Python' started by cerr, Nov 21, 2012.

  1. cerr

    cerr Guest

    Hi,

    I'm using Python's logger for logging but it doesn't seem to roll over, my file is now 2.2MB and should've rolled over after ever 1MB.
    My code:
    logger = logging.getLogger("")
    logger.setLevel(logging.DEBUG)
    handler = logging.handlers.RotatingFileHandler(
    LOGFILE, maxBytes=(1048576*10), backupCount=5
    )

    What am I doing wrong here, I don't get it.
    Thank you!
    Ron
    cerr, Nov 21, 2012
    #1
    1. Advertising

  2. Ron,

    > LOGFILE, maxBytes=(1048576*10), backupCount=5
    > What am I doing wrong here, I don't get it.


    10 * 1048576 = 10MB

    --
    GC
    Gary Chambers, Nov 21, 2012
    #2
    1. Advertising

  3. cerr

    Ron Eggler Guest

    Hooops sh*t! I outsmarted myself I guess... :eek:

    However, Thanks for the kick GC!

    Ron Eggler
    1804 - 1122 Gilford St.
    Vancouver, BC
    V6G 2P5
    (778) 230-9442

    On 12-11-21 11:41 AM, Gary Chambers wrote:
    > Ron,
    >
    >> LOGFILE, maxBytes=(1048576*10), backupCount=5
    >> What am I doing wrong here, I don't get it.

    >
    > 10 * 1048576 = 10MB
    >
    > --
    > GC
    Ron Eggler, Nov 21, 2012
    #3
  4. cerr

    Paul Rubin Guest

    cerr <> writes:
    > 2.2MB and should've rolled over after ever 1MB.
    > LOGFILE, maxBytes=(1048576*10), backupCount=5


    1048576*10 is 10MB, not 1MB.
    Paul Rubin, Nov 21, 2012
    #4
    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
    Replies:
    2
    Views:
    7,318
    brucie
    Oct 3, 2003
  2. sachin
    Replies:
    1
    Views:
    961
    Soren Kuula
    Feb 3, 2006
  3. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    DataGrid Roll-Over Rows

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Jun 19, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    3,122
    Walter Wang [MSFT]
    Jun 20, 2006
  4. cap
    Replies:
    3
    Views:
    282
    James Edward Gray II
    Dec 11, 2005
  5. Georges Ko
    Replies:
    4
    Views:
    265
    Georges Ko
    Jul 26, 2006
Loading...

Share This Page