Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bull.md #3495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions site/docs/extensions/bull.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,12 @@ testQueue.on('completed', function (job, result) {
```typescript
export default {
midwayLogger: {
// ...
bullLogger: {
fileLogName: 'midway-bull.log',
},
clients:{
// ...
bullLogger: {
fileLogName: 'midway-bull.log',
},
}
}
}
```
Expand All @@ -722,12 +724,17 @@ export default {

```typescript
export default {
bull: {
// ...
contextLoggerFormat: info => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个现在是对的。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emmm ,有点迷糊. 意思是format依然要用旧的方式.只是配置变了? 或则是否可以统一?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 contextLoggerFormat 是 framework 上的属性,这里的确有点绕,我晚上再细看。

const { jobId, from } = info.ctx;
return `${info.timestamp} ${info.LEVEL} ${info.pid} [${jobId} ${from.name}] ${info.message}`;
},
midwayLogger: {
clients:{
// ...
bullLogger: {
fileLogName: 'midway-bull.log',
contextLoggerFormat: info => {
const { jobId, from } = info.ctx;
return `${info.timestamp} ${info.LEVEL} ${info.pid} [${jobId} ${from.name}] ${info.message}`;
},
},
}
}
}
```
Expand Down