Skip to content

Commit

Permalink
feat: add extra logs to DTL (#439)
Browse files Browse the repository at this point in the history
* feat: add extra logs to DTL

* chore: add changeset

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
annieke and gakonst authored Apr 15, 2021
1 parent 3c92bdb commit 01eaf2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/angry-queens-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@eth-optimism/core-utils": patch
"@eth-optimism/data-transport-layer": patch
---

added extra logs to base-service / dtl to improve observability
4 changes: 3 additions & 1 deletion packages/core-utils/src/base-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export class BaseService<T> {

this.logger.info('Service is initializing...')
await this._init()
this.logger.info('Service has initialized.')
this.logger.info('Service has initialized.', {
options: this.options,
})
this.initialized = true
}

Expand Down
2 changes: 2 additions & 0 deletions packages/data-transport-layer/src/services/main/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export class L1DataTransportService extends BaseService<L1DataTransportServiceOp
} = {} as any

protected async _init(): Promise<void> {
this.logger.info('Initializing L1 Data Transport Service...')

this.state.db = level(this.options.dbPath)
await this.state.db.open()

Expand Down
5 changes: 5 additions & 0 deletions packages/data-transport-layer/src/services/server/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
url: req.url,
elapsed,
})
this.logger.debug('Response body', {
method: req.method,
url: req.url,
body: json,
})
return res.json(json)
} catch (e) {
const elapsed = Date.now() - start
Expand Down

0 comments on commit 01eaf2c

Please sign in to comment.