You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
109
-
110
-
#### my_log4js_configuration.json ####
109
+
```json
110
+
#### my_log4js_configuration.json ####
111
+
{
112
+
"appenders": [
111
113
{
112
-
"appenders": [
113
-
{
114
-
"type":"file",
115
-
"filename":"relative/path/to/log_file.log",
116
-
"maxLogSize":20480,
117
-
"backups":3,
118
-
"category":"relative-logger"
119
-
},
120
-
{
121
-
"type":"file",
122
-
"absolute":true,
123
-
"filename":"/absolute/path/to/log_file.log",
124
-
"maxLogSize":20480,
125
-
"backups":10,
126
-
"category":"absolute-logger"
127
-
}
128
-
]
114
+
"type": "file",
115
+
"filename": "relative/path/to/log_file.log",
116
+
"maxLogSize": 20480,
117
+
"backups": 3,
118
+
"category": "relative-logger"
119
+
},
120
+
{
121
+
"type": "file",
122
+
"absolute": true,
123
+
"filename": "/absolute/path/to/log_file.log",
124
+
"maxLogSize": 20480,
125
+
"backups": 10,
126
+
"category": "absolute-logger"
129
127
}
130
-
128
+
]
129
+
}
130
+
```
131
131
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.
0 commit comments