日志:短链接记录
This commit is contained in:
@@ -42,7 +42,6 @@ export function checkMaterialEnough(consumes: Array<{ id: number, count: number
|
|||||||
jewelInfo = getJewelById(jewelInfo.nextJewelId);
|
jewelInfo = getJewelById(jewelInfo.nextJewelId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('*******', JSON.stringify(needConsumes));
|
|
||||||
if (comJewelMap[jewel] != jewelCount || Object.keys(comJewelMap).length != 1)//检查最终是否可以合成目标宝石jewel,以及对应的数量jewelCount
|
if (comJewelMap[jewel] != jewelCount || Object.keys(comJewelMap).length != 1)//检查最终是否可以合成目标宝石jewel,以及对应的数量jewelCount
|
||||||
return false;
|
return false;
|
||||||
return needConsumes;
|
return needConsumes;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { genCode } from "@pubUtils/util";
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
return async function log(ctx, next) {
|
||||||
|
ctx.logcode = genCode(10);
|
||||||
|
|
||||||
|
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] request: ${JSON.stringify(ctx.request.body)}`)
|
||||||
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
await next();
|
||||||
|
} catch(e) {
|
||||||
|
ctx.service.utils.log('ERROR', `[${ctx.request.url}] [${ctx.logcode}] err: ${e.stack}`);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
const resBody = ctx.body;
|
||||||
|
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] res: ${JSON.stringify(resBody)}`)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
@@ -36,4 +36,18 @@ export default class Utils extends Service {
|
|||||||
public checkActivityData(data: any, type: number) {
|
public checkActivityData(data: any, type: number) {
|
||||||
return { data, type }
|
return { data, type }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public log(level: 'DEBUG'|'INFO'|'WARN'| 'ERROR', message: string) {
|
||||||
|
const log = this.app.loggers.get('linkLogger');
|
||||||
|
|
||||||
|
if(level == 'DEBUG') {
|
||||||
|
log.error(`${message}`);
|
||||||
|
} else if (level == 'INFO') {
|
||||||
|
log.info(`${message}`);
|
||||||
|
} else if (level == 'WARN') {
|
||||||
|
log.warn(`${message}`);
|
||||||
|
} else if (level == "ERROR") {
|
||||||
|
log.error(`${message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
export default (appInfo: EggAppInfo) => {
|
export default (appInfo: EggAppInfo) => {
|
||||||
const config = {} as PowerPartial<EggAppConfig>;
|
const config = {} as PowerPartial<EggAppConfig>;
|
||||||
@@ -8,7 +9,7 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
config.keys = appInfo.name + '_1600244957952_7142';
|
config.keys = appInfo.name + '_1600244957952_7142';
|
||||||
|
|
||||||
// add your egg config in here
|
// add your egg config in here
|
||||||
config.middleware = [];
|
config.middleware = ['log'];
|
||||||
|
|
||||||
config.cluster = {
|
config.cluster = {
|
||||||
listen: {
|
listen: {
|
||||||
@@ -47,6 +48,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
packages: [ '/root/zyz/web-server/package.json' ],
|
packages: [ '/root/zyz/web-server/package.json' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/gm-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// the return config will combines to EggAppConfig
|
// the return config will combines to EggAppConfig
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
export default (appInfo: EggAppInfo) => {
|
export default (appInfo: EggAppInfo) => {
|
||||||
const config = {} as PowerPartial<EggAppConfig>;
|
const config = {} as PowerPartial<EggAppConfig>;
|
||||||
@@ -8,7 +9,7 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
config.keys = appInfo.name + '_1600244957952_7142';
|
config.keys = appInfo.name + '_1600244957952_7142';
|
||||||
|
|
||||||
// add your egg config in here
|
// add your egg config in here
|
||||||
config.middleware = [];
|
config.middleware = ['log'];
|
||||||
|
|
||||||
config.cluster = {
|
config.cluster = {
|
||||||
listen: {
|
listen: {
|
||||||
@@ -51,6 +52,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
packages: [ '/root/zyz/web-server/package.json' ],
|
packages: [ '/root/zyz/web-server/package.json' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/gm-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// the return config will combines to EggAppConfig
|
// the return config will combines to EggAppConfig
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
export default (appInfo: EggAppInfo) => {
|
export default (appInfo: EggAppInfo) => {
|
||||||
const config = {} as PowerPartial<EggAppConfig>;
|
const config = {} as PowerPartial<EggAppConfig>;
|
||||||
@@ -8,7 +9,7 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
config.keys = appInfo.name + '_1600244957952_7142';
|
config.keys = appInfo.name + '_1600244957952_7142';
|
||||||
|
|
||||||
// add your egg config in here
|
// add your egg config in here
|
||||||
config.middleware = [];
|
config.middleware = ['log'];
|
||||||
|
|
||||||
config.cluster = {
|
config.cluster = {
|
||||||
listen: {
|
listen: {
|
||||||
@@ -47,6 +48,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
packages: [ '/root/zyz/web-server/package.json' ],
|
packages: [ '/root/zyz/web-server/package.json' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/gm-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// the return config will combines to EggAppConfig
|
// the return config will combines to EggAppConfig
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
export default (appInfo: EggAppInfo) => {
|
export default (appInfo: EggAppInfo) => {
|
||||||
const config = {} as PowerPartial<EggAppConfig>;
|
const config = {} as PowerPartial<EggAppConfig>;
|
||||||
@@ -8,7 +9,7 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
config.keys = appInfo.name + '_1600244957952_7142';
|
config.keys = appInfo.name + '_1600244957952_7142';
|
||||||
|
|
||||||
// add your egg config in here
|
// add your egg config in here
|
||||||
config.middleware = [];
|
config.middleware = ['log'];
|
||||||
|
|
||||||
config.cluster = {
|
config.cluster = {
|
||||||
listen: {
|
listen: {
|
||||||
@@ -51,6 +52,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
packages: [ '/root/zyz/web-server/package.json' ],
|
packages: [ '/root/zyz/web-server/package.json' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/gm-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// the return config will combines to EggAppConfig
|
// the return config will combines to EggAppConfig
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
export default (appInfo: EggAppInfo) => {
|
export default (appInfo: EggAppInfo) => {
|
||||||
const config = {} as PowerPartial<EggAppConfig>;
|
const config = {} as PowerPartial<EggAppConfig>;
|
||||||
@@ -8,7 +9,7 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
config.keys = appInfo.name + '_1600244957952_7142';
|
config.keys = appInfo.name + '_1600244957952_7142';
|
||||||
|
|
||||||
// add your egg config in here
|
// add your egg config in here
|
||||||
config.middleware = [];
|
config.middleware = ['log'];
|
||||||
|
|
||||||
config.cluster = {
|
config.cluster = {
|
||||||
listen: {
|
listen: {
|
||||||
@@ -47,6 +48,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
packages: [ '/root/zyz/web-server/package.json' ],
|
packages: [ '/root/zyz/web-server/package.json' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/gm-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// the return config will combines to EggAppConfig
|
// the return config will combines to EggAppConfig
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
+2
@@ -2,10 +2,12 @@
|
|||||||
// Do not modify this file!!!!!!!!!
|
// Do not modify this file!!!!!!!!!
|
||||||
|
|
||||||
import 'egg';
|
import 'egg';
|
||||||
|
import ExportLog from '../../../app/middleware/log';
|
||||||
import ExportTokenParser from '../../../app/middleware/tokenParser';
|
import ExportTokenParser from '../../../app/middleware/tokenParser';
|
||||||
|
|
||||||
declare module 'egg' {
|
declare module 'egg' {
|
||||||
interface IMiddleware {
|
interface IMiddleware {
|
||||||
|
log: typeof ExportLog;
|
||||||
tokenParser: typeof ExportTokenParser;
|
tokenParser: typeof ExportTokenParser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -15,10 +15,10 @@
|
|||||||
"mongoose-lean-getters": "^0.1.2",
|
"mongoose-lean-getters": "^0.1.2",
|
||||||
"mongoose-lean-virtuals": "^0.7.6",
|
"mongoose-lean-virtuals": "^0.7.6",
|
||||||
"mongoose-transactions": "^1.1.4",
|
"mongoose-transactions": "^1.1.4",
|
||||||
|
"request": "^2.88.2",
|
||||||
"request-promise": "^4.2.6",
|
"request-promise": "^4.2.6",
|
||||||
"underscore": "^1.12.0"
|
"underscore": "^1.12.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ENCRYPT_KEY, ENCRYPT_IV } from '@consts';
|
import { ENCRYPT_KEY, ENCRYPT_IV } from '@consts';
|
||||||
|
import { genCode } from 'app/pubUtils/util';
|
||||||
import { Context } from 'egg';
|
import { Context } from 'egg';
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const isJSON = require('koa-is-json');
|
const isJSON = require('koa-is-json');
|
||||||
@@ -21,6 +22,7 @@ module.exports = options => {
|
|||||||
return async function parmsDecode(ctx: Context, next) {
|
return async function parmsDecode(ctx: Context, next) {
|
||||||
let m = ctx.request.url.indexOf("/dev");
|
let m = ctx.request.url.indexOf("/dev");
|
||||||
let n = ctx.request.url.indexOf("/web");
|
let n = ctx.request.url.indexOf("/web");
|
||||||
|
ctx.logcode = genCode(10);
|
||||||
if(m == 0 || n == 0) {
|
if(m == 0 || n == 0) {
|
||||||
await next();
|
await next();
|
||||||
return;
|
return;
|
||||||
@@ -47,17 +49,27 @@ module.exports = options => {
|
|||||||
try {
|
try {
|
||||||
ctx.request.body = JSON.parse(decodeStr);
|
ctx.request.body = JSON.parse(decodeStr);
|
||||||
console.log('req body', ctx.request.body);
|
console.log('req body', ctx.request.body);
|
||||||
|
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] request: ${JSON.stringify(ctx.request.body)}`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('parms parse err');
|
console.error('parms parse err');
|
||||||
|
ctx.service.utils.log('ERROR', `[${ctx.request.url}] [${ctx.logcode}] request: parms parse err`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await next();
|
try{
|
||||||
|
await next();
|
||||||
|
} catch(e) {
|
||||||
|
ctx.service.utils.log('ERROR', `[${ctx.request.url}] [${ctx.logcode}] err: ${e.stack}`);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
const resBody = ctx.body;
|
const resBody = ctx.body;
|
||||||
console.log('return value:', JSON.stringify(resBody));
|
console.log('return value:', JSON.stringify(resBody));
|
||||||
if (isJSON(resBody)) {
|
if (isJSON(resBody)) {
|
||||||
ctx.body = { result: aesEncrypt(JSON.stringify(resBody), ENCRYPT_KEY, ENCRYPT_IV) };
|
ctx.body = { result: aesEncrypt(JSON.stringify(resBody), ENCRYPT_KEY, ENCRYPT_IV) };
|
||||||
|
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] res: ${JSON.stringify(resBody)}`)
|
||||||
} else {
|
} else {
|
||||||
ctx.body = { result: aesEncrypt(JSON.stringify({ status: 3, data: 'internal err' }), ENCRYPT_KEY, ENCRYPT_IV) };
|
ctx.body = { result: aesEncrypt(JSON.stringify({ status: 3, data: 'internal err' }), ENCRYPT_KEY, ENCRYPT_IV) };
|
||||||
|
ctx.service.utils.log('ERROR', `[${ctx.request.url}] [${ctx.logcode}] res: ${resBody}`)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ module.exports = () => {
|
|||||||
ctx.userCode = user.userCode;
|
ctx.userCode = user.userCode;
|
||||||
ctx.pkgName = user.pkgName;
|
ctx.pkgName = user.pkgName;
|
||||||
ctx.tel = user.tel;
|
ctx.tel = user.tel;
|
||||||
|
ctx.service.utils.log('INFO', `[${ctx.request.url}] [${ctx.logcode}] user: ${user.uid}`);
|
||||||
|
|
||||||
await next();
|
await next();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -54,4 +54,18 @@ export default class Utils extends Service {
|
|||||||
public unlockFigure(roleId: string, conditions: {type: number, paramHid?: number, paramFavourLv?: number, paramSkinId?: number}[], role?: RoleType) {
|
public unlockFigure(roleId: string, conditions: {type: number, paramHid?: number, paramFavourLv?: number, paramSkinId?: number}[], role?: RoleType) {
|
||||||
return unlockFigure(roleId, conditions, role);
|
return unlockFigure(roleId, conditions, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public log(level: 'DEBUG'|'INFO'|'WARN'| 'ERROR', message: string) {
|
||||||
|
const log = this.app.loggers.get('linkLogger');
|
||||||
|
|
||||||
|
if(level == 'DEBUG') {
|
||||||
|
log.error(`${message}`);
|
||||||
|
} else if (level == 'INFO') {
|
||||||
|
log.info(`${message}`);
|
||||||
|
} else if (level == 'WARN') {
|
||||||
|
log.warn(`${message}`);
|
||||||
|
} else if (level == "ERROR") {
|
||||||
|
log.error(`${message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,21 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||||
|
|||||||
@@ -53,7 +53,22 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
appSecret: 'a48ad5ca44e2d02cbd7f4c0326fa3101',
|
appSecret: 'a48ad5ca44e2d02cbd7f4c0326fa3101',
|
||||||
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
|
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||||
|
|||||||
@@ -46,7 +46,21 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
prefix: '/',
|
prefix: '/',
|
||||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||||
};
|
};
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
|
|||||||
@@ -47,7 +47,21 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||||
|
|||||||
@@ -40,13 +40,28 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
config.decodeParm = false;
|
config.decodeParm = true;
|
||||||
|
|
||||||
config.static = {
|
config.static = {
|
||||||
prefix: '/',
|
prefix: '/',
|
||||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
|
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
|
|||||||
@@ -47,7 +47,21 @@ export default (appInfo: EggAppInfo) => {
|
|||||||
dir: path.join(appInfo.baseDir, '/app/public'),
|
dir: path.join(appInfo.baseDir, '/app/public'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.customLogger = {
|
||||||
|
linkLogger: {
|
||||||
|
file: path.join(appInfo.root, 'logs/web-server/link-log.log'),
|
||||||
|
formatter(meta) {
|
||||||
|
return `[${meta.level}] [${meta.date}] ${meta.message}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
config.logrotator = {
|
||||||
|
filesRotateBySize: [
|
||||||
|
path.join(appInfo.root, 'logs/link-log.log'),
|
||||||
|
],
|
||||||
|
maxFileSize: 1024,
|
||||||
|
};
|
||||||
// add your special config in here
|
// add your special config in here
|
||||||
const bizConfig = {
|
const bizConfig = {
|
||||||
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
"egg-scripts": "^2.6.0",
|
"egg-scripts": "^2.6.0",
|
||||||
"egg-view-nunjucks": "^2.2.0",
|
"egg-view-nunjucks": "^2.2.0",
|
||||||
"egg-xtransit": "^1.2.2",
|
"egg-xtransit": "^1.2.2",
|
||||||
|
"moment": "^2.29.1",
|
||||||
"mongoose-transactions": "^1.1.4",
|
"mongoose-transactions": "^1.1.4",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user