NodeJS winston log file not change upon size limit

Lee picture Lee · Jul 30, 2014 · Viewed 10.6k times · Source

I'm using Winston logging and have specified file size to be max 10MB.

{
    filename: 'e:\app.log', 
    json:false, 
    maxsize:'10MB', 
    maxFiles:'10', 
    timestamp:true, 
    level:'silly'
}

I'm expecting the app.log file to be rotated upon size reaching 10MB, but this has never happened and my log file grows to even GBs.

Is there something I'm doing wrongly? Thanks.

Answer

Victor Castillo Torres picture Victor Castillo Torres · Jul 30, 2014

As you can see here the maxsize must be in bytes so change it for 10000000