dateFile appender stops writing to file when tailing logfile after rotation #118

Open
stiang opened this Issue Feb 26, 2013 · 1 comment

2 participants

@stiang

We use the dateFile appender with the following config:

{
  "appenders": [
    { 
      "type": "dateFile",
      "filename": "/var/log/foo-server.log",
      "pattern": "-yyyy-MM-dd",
      "backups": 2
    }
  ],
  "levels": {
    "server": "WARN"
  }
}

The logfile is rotated as per the config and everything appears to work just fine, but if I "tail -f" the currently active log file after it has been rotated, node will stop writing to it at the precise moment when I access the file. If I restart node I can "tail -f" the active log file just fine, but only until it gets rotated.

Versions:

  • log4js v0.5.6
  • node v0.8.19
  • Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-37-virtual x86_64)
@svnindia

Same things happens for me too... Is there a solution ?

Yesterdays log file has todays 3 line of logs and todays logs are not going to the expected log file.

I am using log4js with Sails & PM2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment