Skip to content

Commit

Permalink
Dont dump stacktrace in http logger middleware (bluesky-social#1753)
Browse files Browse the repository at this point in the history
* dont dump stacktrace in http logger middleware

* build branch

* dont build

* do in appview as well

* build branch again

* dont build
  • Loading branch information
dholms authored Oct 23, 2023
1 parent 9100d30 commit e14780a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/bsky/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ export const httpLogger: ReturnType<typeof subsystemLogger> =

export const loggerMiddleware = pinoHttp({
logger: httpLogger,
serializers: {
err: (err) => {
return {
code: err?.code,
message: err?.message,
}
},
},
})
6 changes: 6 additions & 0 deletions packages/pds/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export const httpLogger = subsystemLogger('pds')
export const loggerMiddleware = pinoHttp({
logger: httpLogger,
serializers: {
err: (err) => {
return {
code: err?.code,
message: err?.message,
}
},
req: (req) => {
const serialized = pino.stdSerializers.req(req)
const authHeader = serialized.headers.authorization || ''
Expand Down

0 comments on commit e14780a

Please sign in to comment.