Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
express-log-middleware
Advanced tools
app.use(
require('express-log-middleware')(config)
);
name | type | description |
---|---|---|
config.model | string | 项目模板名称(用于指定Elasticsearch中的index) 必填项 |
config.level | string | 日志输出级别 |
config.logDir | string | 日志输出路径 |
config.getBusinessData | function | 获取业务专有数据(这些数据会一同发送到日志服务) 参数 params req |
config.onParams | function | 对缺省params进行处理,返回处理后params 参数 params req |
config.filter | function | 过滤函数,不提供此函数或返回true代表需要输出日志 参数 req |
config.logEnv | string | 日志环境 目前EFK/ELK 项目迁移进openshift之后使用其中集成的EFK不用再使用log4js收集日志; default: "ELK" |
//logEnv = "EFK"
app.use(
require('express-log-middleware')({logEnv: 'EFK'}); //如果logEnv是EFK, 只用这一个配置即可;
)
//logEnv = "ELK"
app.use(
require('express-log-middleware')({model: 'education_cloud'})
);
app.use(
require('express-log-middleware')({
model: 'education_cloud',
onParams: (params,req) => ({userId:req.user.id})
})
);
app.use(require('express-log-middleware')({
model: 'education_cloud',
getBusinessData: function (params, req) {
let user = req.user || {};
const customer = req.customer || {};
return {
userId: user.id || -1,
customeUrl:customer.url || '-'
}
}
}));
req.logger.log('xxx')
req.logger.error('xxx')
console.log(JSON.stringify({})); //如果输出日志是jsonstring, EFK会处parse之后提取key/value
console.log('this is a test'); //字符串输出
console.warn('debug尽量不要换行输出');
FAQs
### 说明
The npm package express-log-middleware receives a total of 2 weekly downloads. As such, express-log-middleware popularity was classified as not popular.
We found that express-log-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.