csausdev/log4js-node — Issue #47: finding log4js.json
Author: riseuplabs
Created: 2011-12-01 05:53:34+00:00
State: open

Hi,

I'm using etherpad-lite (https://github.com/Pita/etherpad-lite) which uses node.js and log4js-node. Due to some problem with socket code, I got a very large logfile and I realized that it was time to set up log rotation. I started to look into how this was done with log4js and I found that there is built-in logrolling, I just need to configure it.

Great. So since the application isn't configuring this anywhere, I followed the directions and created a log4js.json file with the following content straight from the example:

```
{
"appenders": [
{
"type": "file",
"filename": "/var/log/etherpad-lite/etherpad-lite.log",
"maxLogSize": 1024,
"backups": 3,
"pollInterval": 15
}
]
}
```

and then I puzzled over where I was supposed to put it. The documentation says the CWD is the first place looked, so I tried to figure out where exactly the CWD was. I decided the most logical place was the CWD of the node process, so I put it there (based on the value from /proc//cwd). It didn't seem to fire there. My current log file is larger than 1024 (by the way, what unit is that? bytes? megabytes?), so I expected it to rotate, but it didn't do anything. I plopped the log4js.json in various other locations that made less and less sense, including until I gave up.

Am I misunderstanding how this should work or is there a bug here?

thanks!