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:
81
+
82
+
#### my_log4js_configuration.json ####
83
+
{
84
+
"appenders": [
85
+
{
86
+
"type": "file",
87
+
"filename": "relative/path/to/log_file.log",
88
+
"maxLogSize": 20480,
89
+
"backups": 3,
90
+
"pollInterval": 15,
91
+
"category": "relative-logger"
92
+
},
93
+
{
94
+
"type": "file",
95
+
"absolute": true,
96
+
"filename": "/absolute/path/to/log_file.log",
97
+
"maxLogSize": 20480,
98
+
"backups": 10,
99
+
"pollInterval": 15,
100
+
"category": "absolute-logger"
101
+
}
102
+
]
103
+
}
104
+
76
105
## connect/express logger
77
106
78
107
A connect/express logger has been added to log4js, by [danbell](https://github.com/danbell). This allows connect/express servers to log using log4js. See example-connect-logger.js.
@@ -220,6 +249,24 @@ This was mainly created for [cluster](https://github.com/LearnBoost/cluster), bu
220
249
.listen(3000);
221
250
</pre>
222
251
252
+
## gelf logger
253
+
254
+
A gelf logger has been added to log4js, by [arifamirani](https://github.com/arifamirani). This allows log4js to log to [GELF](http://www.graylog2.org/about/gelf) compatible servers such as [Graylog](http://www.graylog2.org/). This is currently configuration based and needs the following configuration to be added to log4j.json. For example:
255
+
256
+
<pre>
257
+
{
258
+
"appenders": [
259
+
{
260
+
"type": "gelf",
261
+
"host": "logs.mydomain.com", //defaults to localhost
262
+
"hostname":"mrs-dev", //defaults to the value returned by os.hostname()
0 commit comments