If you have already defined an absolute path for one of the FileAppenders in the configuration file, you could add a "absolute": true to the particular FileAppender to override the cwd option passed. Here is an example configuration file:
If you have already defined an absolute path for one of the FileAppenders in the configuration file, you could add a "absolute": true to the particular FileAppender to override the cwd option passed. Here is an example configuration file:
```json
#### my_log4js_configuration.json ####
#### my_log4js_configuration.json ####
{
"appenders": [
{
{
"appenders": [
"type": "file",
{
"filename": "relative/path/to/log_file.log",
"type": "file",
"maxLogSize": 20480,
"filename": "relative/path/to/log_file.log",
"backups": 3,
"maxLogSize": 20480,
"category": "relative-logger"
"backups": 3,
},
"category": "relative-logger"
{
},
"type": "file",
{
"absolute": true,
"type": "file",
"filename": "/absolute/path/to/log_file.log",
"absolute": true,
"maxLogSize": 20480,
"filename": "/absolute/path/to/log_file.log",
"backups": 10,
"maxLogSize": 20480,
"category": "absolute-logger"
"backups": 10,
"category": "absolute-logger"
}
]
}
}
]
}
```
Documentation for most of the core appenders can be found on the [wiki](log4js-node/wiki/Appenders), otherwise take a look at the tests and the examples.
Documentation for most of the core appenders can be found on the [wiki](log4js-node/wiki/Appenders), otherwise take a look at the tests and the examples.