Add optional timezoneOffset config for appenders
Example:
log4js.configure({
appenders: [{type: 'console', timezoneOffset: -540}],
replaceConsole: true
});
The expected value is the equivalent of (new Date).getTimezoneOffset()
In this example, -540 is the value for JST.
This allows machines members of world-wide-spread cluster to all report
log time-stamps using the same timezone (or adapt the timezone to a
local different from the system)
This commit is contained in:
@@ -28,7 +28,7 @@ function smtpAppender(config, layout) {
|
||||
var firstEvent = logEventBuffer[0];
|
||||
var body = "";
|
||||
while (logEventBuffer.length > 0) {
|
||||
body += layout(logEventBuffer.shift()) + "\n";
|
||||
body += layout(logEventBuffer.shift(), config.timezoneOffset) + "\n";
|
||||
}
|
||||
|
||||
var msg = {
|
||||
|
||||
Reference in New Issue
Block a user