Skip to content

Commit

Permalink
fix(logging): inject runtime into microservice instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdharvey-ibm committed May 11, 2023
1 parent 43ff2ce commit cb2bb1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/logging/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
import { Logging } from '@carbon-platform/api/logging'
import { EventMessage, Queue } from '@carbon-platform/api/messaging'
import { PlatformMicroservice } from '@carbon-platform/api/microservice'
import { Runtime } from '@carbon-platform/api/runtime'

import { LoggingModule } from './logging-module.js'

async function start() {
const runtime = new Runtime()

// Disable remote logging entirely for the logging service
Logging.isRemoteLoggingAllowed = false

const pm = new PlatformMicroservice({
queue: Queue.Logging,
module: LoggingModule,
autoAck: true // Remove messages immediately from the queue without explicit ack
autoAck: true, // Remove messages immediately from the queue without explicit ack
runtime
})

await pm.bind<EventMessage>('log_logged')
Expand Down

0 comments on commit cb2bb1b

Please sign in to comment.