Activity logging using temporal server cli

During development using the standalone temporal binary I am unable to view any activity logs on the server.

The server is started with:

temporal server start-dev --namespace=development

In an activity using typescript SDK:
import { log } from “@temporalio/activity”

log.info(message!)

When using temporal within docker this log message is visible on the server.

Thanks in advance
Tate

Hi,

During development using the standalone temporal binary I am unable to view any activity logs on the server.

I guess you mean the workers, the one that run workflow and activity tasks

Can you try adding the logs to this example samples-typescript/hello-world/src/activities.ts at cc1a3ee2696866f75966b2968ef2291bd5b852f1 · temporalio/samples-typescript · GitHub

It can also be the log configuration , could you review it?

Runtime.install({ logger:....

Antonio

I will provide some more code details shortly. But as mentioned the logs do appear when running temporal in a container.

The issue was related to the telemetryOptions when the filtering is set to INFO. Even though the messages are at INFO level.

filter: makeTelemetryFilterString({ core: 'INFO' }),

Nothing appears for activities or workflows. If this toggled to DEBUG the log messages appear.
If I remove the filter from the telemetryOptions nothing appears.

This is reproducible using the example at:

Change
filter: makeTelemetryFilterString({ core: 'DEBUG }),
to
filter: makeTelemetryFilterString({ core: 'INFO }),

What is the impact to the performance based on this comment in the example?

// This filter determines which logs should be forwarded from Rust Core to the Node.js logger.
// Note: In production, WARN should generally be enough. DEBUG is quite verbose.

see below…

  Runtime.install({
    // Install a logger to collect logs generated by Node.js Workers and Rust Core.
    // Note: In production, WARN should generally be enough. DEBUG is quite verbose.
    logger: new DefaultLogger('INFO', (entry) => {
      winstonLogger.log({
        label: entry.meta?.activityId ? 'activity' : entry.meta?.workflowId ? 'workflow' : 'worker',
        level: entry.level.toLowerCase(),
        message: entry.message,
        timestamp: Number(entry.timestampNanos / 1_000_000n),
        ...entry.meta,
      });
    }),
    // Telemetry options control how logs are exported out of Rust Core.
    telemetryOptions: {
      logging: {
        // By default, Core logs go directly to console. Setting the `forward` property here (to an
        // empty object) enables forwarding of logs from Rust Core to the Node.js logger.
        forward: {},
        // This filter determines which logs should be forwarded from Rust Core to the Node.js logger.
        // Note: In production, WARN should generally be enough. DEBUG is quite verbose.
        filter: makeTelemetryFilterString({ core: 'INFO' }),
      },
    },
  });