Commit 6c1fcbec authored by huhao's avatar huhao

修复location为空的bug

parent 9c2eeb66
...@@ -14,7 +14,7 @@ function location(loggingEvent) { ...@@ -14,7 +14,7 @@ function location(loggingEvent) {
if (loggingEvent.callStack) { if (loggingEvent.callStack) {
return `${loggingEvent.categoryName} ${loggingEvent.functionName}(${loggingEvent.fileName}:${loggingEvent.lineNumber}:${loggingEvent.columnNumber})`; return `${loggingEvent.categoryName} ${loggingEvent.functionName}(${loggingEvent.fileName}:${loggingEvent.lineNumber}:${loggingEvent.columnNumber})`;
} }
return loggingEvent.categoryName === 'default' ? undefined : loggingEvent.categoryName; return loggingEvent.categoryName || '';
} }
function time(loggingEvent, timeFormat, timezoneOffset) { function time(loggingEvent, timeFormat, timezoneOffset) {
...@@ -35,7 +35,7 @@ module.exports.configure = function (config, layouts) { ...@@ -35,7 +35,7 @@ module.exports.configure = function (config, layouts) {
const layout = config.layout ? const layout = config.layout ?
layouts.layout(config.layout.type, config.layout) : layouts.layout(config.layout.type, config.layout) :
layouts.layout; layouts.layout;
const timeFormat = config.timeFormat || dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT; const timeFormat = config.timeFormat || 'yyyy-MM-ddThh:mmO';
const sls = new ALY.SLS(config); const sls = new ALY.SLS(config);
const { projectName, logStoreName, topic } = config; const { projectName, logStoreName, topic } = config;
......
{ {
"name": "log4js-aliyun-sls", "name": "log4js-aliyun-sls",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment