mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-30 16:55:08 +08:00
support setting logger level
This commit is contained in:
@@ -52,4 +52,5 @@ module.exports = {
|
||||
pass: process.env.HTTP_BASIC_AUTH_PASS || 'passw0rd',
|
||||
},
|
||||
puppeteerWSEndpoint: process.env.PUPPETEER_WS_ENDPOINT,
|
||||
loggerLevel: process.env.LOGGER_LEVEL || 'info',
|
||||
};
|
||||
|
||||
@@ -278,6 +278,8 @@ Use environment variables is recommended to avoid conflicts during upgrade.
|
||||
|
||||
`HTTP_BASIC_AUTH_PASS`: Http basic authentication password, default to `passw0rd`, please change asap
|
||||
|
||||
`LOGGER_LEVEL`: specifies the maximum [level](https://github.com/winstonjs/winston#logging-levels) of messages to the console and log file, default to `info`
|
||||
|
||||
### User Authentication
|
||||
|
||||
Routes in `protected_route.js` will be protected using HTTP Basic Authentication.
|
||||
|
||||
@@ -284,6 +284,8 @@ gcloud app deploy
|
||||
|
||||
`HTTP_BASIC_AUTH_PASS`: Http basic authentication 密码, 默认为 `passw0rd`, 请务必修改
|
||||
|
||||
`LOGGER_LEVEL`: 指明输出到 console 和日志文件的日志的最大[等级](https://github.com/winstonjs/winston#logging-levels),默认 `info`
|
||||
|
||||
### 用户认证
|
||||
|
||||
`protected_route.js` 内的路由将启用 HTTP Basic Authentication 认证.
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
const winston = require('winston');
|
||||
const config = require('../config');
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
level: config.loggerLevel,
|
||||
format: winston.format.json(),
|
||||
transports: [
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user