Open History to see the last commit
1import { PRIMARY_LOCAL_ENVIRONMENT_ID } from "@t3tools/contracts";
2import {
3 makeLocalFileTracer,
4 makeTraceSink,
5 otlpSerializationLayer,
6} from "@t3tools/shared/observability";
7import { parsePersistedServerObservabilitySettings } from "@t3tools/shared/serverSettings";
8import * as Context from "effect/Context";
9import * as DateTime from "effect/DateTime";
10import * as Effect from "effect/Effect";
11import * as FileSystem from "effect/FileSystem";
12import * as Layer from "effect/Layer";
13import * as Logger from "effect/Logger";
14import * as Option from "effect/Option";
15import * as Path from "effect/Path";
16import * as PlatformError from "effect/PlatformError";
17import * as References from "effect/References";
18import * as Ref from "effect/Ref";
19import * as Schema from "effect/Schema";
20import * as Scope from "effect/Scope";
21import * as Semaphore from "effect/Semaphore";
22import * as SynchronizedRef from "effect/SynchronizedRef";
23import * as Tracer from "effect/Tracer";
24import { OtlpExporter, OtlpTracer } from "effect/unstable/observability";
25
26import * as DesktopEnvironment from "./DesktopEnvironment.ts";
27
28const DESKTOP_LOG_FILE_MAX_BYTES = 10 * 1024 * 1024;
29const DESKTOP_LOG_FILE_MAX_FILES = 10;
30const DESKTOP_BACKEND_CHILD_LOG_FIBER_ID = "#backend-child";
31const DESKTOP_TRACE_BATCH_WINDOW_MS = 1_000;
32const DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_BYTES = 1024 * 1024;
33const DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_CHUNKS = 256;
34
35export interface RotatingLogFileWriter {
36 readonly writeBytes: (chunk: Uint8Array) => Effect.Effect<void>;
37 readonly writeText: (chunk: string) => Effect.Effect<void>;
38}
39
40export interface DesktopBackendOutputLogShape {
41 readonly beginSession: (input: { readonly details: string }) => Effect.Effect<void>;
42 readonly writeOutputChunk: (
43 streamName: "stdout" | "stderr",
44 chunk: Uint8Array,
45 ) => Effect.Effect<void>;
46 readonly persistFailureSnapshot: (input: { readonly details: string }) => Effect.Effect<void>;
47 readonly persistFailure: (input: { readonly details: string }) => Effect.Effect<void>;
48 readonly discardSession: Effect.Effect<void>;
49}
50
51// Factory for per-instance backend output logs. `forInstance(id)` returns
52// a writer that targets a distinct rotating log file — the primary
53// instance keeps `server-child.log` so the historical path stays stable
54// for ops; other instances get `server-child-<sanitized-id>.log`.
55//
56// Writers are cached per id within a single factory instance so repeated
57// `forInstance` calls (e.g. during a backend restart that re-resolves
58// services) reuse the same rotating writer rather than racing each other
59// on the same file.
60export class DesktopBackendOutputLogFactory extends Context.Service<
61 DesktopBackendOutputLogFactory,
62 {
63 readonly forInstance: (id: string) => Effect.Effect<DesktopBackendOutputLogShape>;
64 }
65>()("@t3tools/desktop/app/DesktopObservability/DesktopBackendOutputLogFactory") {}
66
67const textEncoder = new TextEncoder();
68const textDecoder = new TextDecoder();
69
70export type DesktopLogAnnotations = Record<string, unknown>;
71
72export interface DesktopComponentLogger {
73 readonly annotate: <A, E, R>(
74 effect: Effect.Effect<A, E, R>,
75 annotations?: DesktopLogAnnotations,
76 ) => Effect.Effect<A, E, R>;
77 readonly logDebug: (message: string, annotations?: DesktopLogAnnotations) => Effect.Effect<void>;
78 readonly logInfo: (message: string, annotations?: DesktopLogAnnotations) => Effect.Effect<void>;
79 readonly logWarning: (
80 message: string,
81 annotations?: DesktopLogAnnotations,
82 ) => Effect.Effect<void>;
83 readonly logError: (message: string, annotations?: DesktopLogAnnotations) => Effect.Effect<void>;
84}
85
86export function makeComponentLogger(component: string): DesktopComponentLogger {
87 const annotate: DesktopComponentLogger["annotate"] = (effect, annotations) =>
88 effect.pipe(
89 Effect.annotateLogs({
90 component,
91 ...annotations,
92 }),
93 );
94
95 return {
96 annotate,
97 logDebug: (message, annotations) => annotate(Effect.logDebug(message), annotations),
98 logInfo: (message, annotations) => annotate(Effect.logInfo(message), annotations),
99 logWarning: (message, annotations) => annotate(Effect.logWarning(message), annotations),
100 logError: (message, annotations) => annotate(Effect.logError(message), annotations),
101 };
102}
103
104class DesktopLogFileWriterConfigurationError extends Schema.TaggedError<DesktopLogFileWriterConfigurationError>()(
105 "DesktopLogFileWriterConfigurationError",
106 {
107 option: Schema.Literals(["maxBytes", "maxFiles"]),
108 value: Schema.Number,
109 },
110) {
111 override get message() {
112 return `${this.option} must be >= 1 (received ${this.value})`;
113 }
114}
115
116type DesktopLogFileWriterError =
117 | DesktopLogFileWriterConfigurationError
118 | PlatformError.PlatformError;
119
120const sanitizeLogValue = (value: string): string => value.replace(/\s+/g, " ").trim();
121
122const DesktopBackendChildLogRecord = Schema.Struct({
123 message: Schema.String,
124 level: Schema.Literals(["INFO", "ERROR"]),
125 timestamp: Schema.String,
126 annotations: Schema.Record(Schema.String, Schema.Unknown),
127 spans: Schema.Record(Schema.String, Schema.Unknown),
128 fiberId: Schema.String,
129});
130
131const encodeDesktopBackendChildLogRecord = Schema.encodeEffect(
132 Schema.fromJsonString(DesktopBackendChildLogRecord),
133);
134
135const DesktopBackendOutputLogNoop: DesktopBackendOutputLogShape = {
136 beginSession: () => Effect.void,
137 writeOutputChunk: () => Effect.void,
138 persistFailureSnapshot: () => Effect.void,
139 persistFailure: () => Effect.void,
140 discardSession: Effect.void,
141};
142
143interface BufferedBackendOutputChunk {
144 readonly streamName: "stdout" | "stderr";
145 readonly chunk: Uint8Array;
146 readonly offset: number;
147}
148
149interface BackendOutputSession {
150 readonly runId: string;
151 readonly startDetails: string;
152 readonly chunks: ReadonlyArray<BufferedBackendOutputChunk>;
153 readonly byteLength: number;
154}
155
156export function appendBoundedOutputChunk(
157 session: BackendOutputSession,
158 streamName: "stdout" | "stderr",
159 chunk: Uint8Array,
160): BackendOutputSession {
161 if (chunk.byteLength === 0) {
162 return session;
163 }
164
165 const retainedChunk =
166 chunk.byteLength > DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_BYTES
167 ? chunk.slice(chunk.byteLength - DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_BYTES)
168 : chunk.slice();
169 const chunks = [...session.chunks, { streamName, chunk: retainedChunk, offset: 0 }];
170 let byteLength = session.byteLength + retainedChunk.byteLength;
171 let overflow = Math.max(0, byteLength - DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_BYTES);
172 let firstRetainedIndex = 0;
173
174 while (overflow > 0) {
175 const first = chunks[firstRetainedIndex];
176 if (!first) break;
177 const retainedByteLength = first.chunk.byteLength - first.offset;
178 if (retainedByteLength <= overflow) {
179 overflow -= retainedByteLength;
180 byteLength -= retainedByteLength;
181 firstRetainedIndex += 1;
182 continue;
183 }
184
185 chunks[firstRetainedIndex] = {
186 ...first,
187 offset: first.offset + overflow,
188 };
189 byteLength -= overflow;
190 overflow = 0;
191 }
192
193 const excessChunks = Math.max(
194 0,
195 chunks.length - firstRetainedIndex - DESKTOP_BACKEND_OUTPUT_BUFFER_MAX_CHUNKS,
196 );
197 for (let index = firstRetainedIndex; index < firstRetainedIndex + excessChunks; index += 1) {
198 const chunk = chunks[index];
199 byteLength -= chunk ? chunk.chunk.byteLength - chunk.offset : 0;
200 }
201 firstRetainedIndex += excessChunks;
202
203 return {
204 ...session,
205 chunks: chunks.slice(firstRetainedIndex),
206 byteLength,
207 };
208}
209
210const currentDesktopRunId = Effect.gen(function* () {
211 const annotations = yield* References.CurrentLogAnnotations;
212 const runId = annotations.runId;
213 return typeof runId === "string" && runId.length > 0 ? runId : "unknown";
214});
215
216const refreshFileSize = (
217 fileSystem: FileSystem.FileSystem,
218 filePath: string,
219): Effect.Effect<number, never> =>
220 fileSystem.stat(filePath).pipe(
221 Effect.map((stat) => Number(stat.size)),
222 Effect.orElseSucceed(() => 0),
223 );
224
225const makeRotatingLogFileWriter = Effect.fn("makeRotatingLogFileWriter")(function* (input: {
226 readonly filePath: string;
227 readonly maxBytes?: number;
228 readonly maxFiles?: number;
229}): Effect.fn.Return<
230 RotatingLogFileWriter,
231 DesktopLogFileWriterError,
232 FileSystem.FileSystem | Path.Path
233> {
234 const fileSystem = yield* FileSystem.FileSystem;
235 const path = yield* Path.Path;
236 const maxBytes = input.maxBytes ?? DESKTOP_LOG_FILE_MAX_BYTES;
237 const maxFiles = input.maxFiles ?? DESKTOP_LOG_FILE_MAX_FILES;
238 const directory = path.dirname(input.filePath);
239 const baseName = path.basename(input.filePath);
240
241 if (maxBytes < 1) {
242 return yield* new DesktopLogFileWriterConfigurationError({
243 option: "maxBytes",
244 value: maxBytes,
245 });
246 }
247 if (maxFiles < 1) {
248 return yield* new DesktopLogFileWriterConfigurationError({
249 option: "maxFiles",
250 value: maxFiles,
251 });
252 }
253
254 yield* fileSystem.makeDirectory(directory, { recursive: true });
255
256 const withSuffix = (index: number) => `${input.filePath}.${index}`;
257 const currentSize = yield* Ref.make(yield* refreshFileSize(fileSystem, input.filePath));
258 const mutex = yield* Semaphore.make(1);
259
260 const pruneOverflowBackups = Effect.gen(function* () {
261 const entries = yield* fileSystem.readDirectory(directory).pipe(Effect.orElseSucceed(() => []));
262 for (const entry of entries) {
263 if (!entry.startsWith(`${baseName}.`)) continue;
264 const suffix = Number(entry.slice(baseName.length + 1));
265 if (!Number.isInteger(suffix) || suffix <= maxFiles) continue;
266 yield* fileSystem.remove(path.join(directory, entry), { force: true }).pipe(Effect.ignore);
267 }
268 });
269
270 const rotate = Effect.gen(function* () {
271 yield* fileSystem.remove(withSuffix(maxFiles), { force: true }).pipe(Effect.ignore);
272 for (let index = maxFiles - 1; index >= 1; index -= 1) {
273 const source = withSuffix(index);
274 const sourceExists = yield* fileSystem.exists(source).pipe(Effect.orElseSucceed(() => false));
275 if (sourceExists) {
276 yield* fileSystem.rename(source, withSuffix(index + 1));
277 }
278 }
279 const currentExists = yield* fileSystem
280 .exists(input.filePath)
281 .pipe(Effect.orElseSucceed(() => false));
282 if (currentExists) {
283 yield* fileSystem.rename(input.filePath, withSuffix(1));
284 }
285 yield* Ref.set(currentSize, 0);
286 }).pipe(
287 Effect.catch(() =>
288 refreshFileSize(fileSystem, input.filePath).pipe(
289 Effect.flatMap((size) => Ref.set(currentSize, size)),
290 ),
291 ),
292 );
293
294 const writeBytes = (chunk: Uint8Array): Effect.Effect<void> => {
295 if (chunk.byteLength === 0) return Effect.void;
296
297 return mutex.withPermits(1)(
298 Effect.gen(function* () {
299 const beforeSize = yield* Ref.get(currentSize);
300 if (beforeSize > 0 && beforeSize + chunk.byteLength > maxBytes) {
301 yield* rotate;
302 }
303
304 yield* fileSystem.writeFile(input.filePath, chunk, { flag: "a" });
305 const afterSize = (yield* Ref.get(currentSize)) + chunk.byteLength;
306 yield* Ref.set(currentSize, afterSize);
307
308 if (afterSize > maxBytes) {
309 yield* rotate;
310 }
311 }).pipe(
312 Effect.catch(() =>
313 refreshFileSize(fileSystem, input.filePath).pipe(
314 Effect.flatMap((size) => Ref.set(currentSize, size)),
315 ),
316 ),
317 ),
318 );
319 };
320
321 yield* pruneOverflowBackups;
322
323 return {
324 writeBytes,
325 writeText: (chunk) => writeBytes(textEncoder.encode(chunk)),
326 } satisfies RotatingLogFileWriter;
327});
328
329const readPersistedOtlpTracesUrl: Effect.Effect<
330 Option.Option<string>,
331 never,
332 FileSystem.FileSystem | DesktopEnvironment.DesktopEnvironment
333> = Effect.gen(function* () {
334 const fileSystem = yield* FileSystem.FileSystem;
335 const environment = yield* DesktopEnvironment.DesktopEnvironment;
336 const raw = yield* fileSystem.readFileString(environment.serverSettingsPath).pipe(Effect.option);
337 if (Option.isNone(raw)) {
338 return Option.none();
339 }
340
341 const parsed = parsePersistedServerObservabilitySettings(raw.value);
342 return Option.fromNullishOr(parsed.otlpTracesUrl);
343});
344
345const resolveOtlpTracesUrl = Effect.gen(function* () {
346 const environment = yield* DesktopEnvironment.DesktopEnvironment;
347 if (Option.isSome(environment.otlpTracesUrl)) {
348 return environment.otlpTracesUrl;
349 }
350 return yield* readPersistedOtlpTracesUrl;
351});
352
353const writeDevelopmentConsoleOutput = (
354 streamName: "stdout" | "stderr",
355 chunk: Uint8Array,
356): Effect.Effect<void> =>
357 Effect.sync(() => {
358 const output = streamName === "stderr" ? process.stderr : process.stdout;
359 output.write(chunk);
360 }).pipe(Effect.ignore);
361
362const writeBackendChildLogRecord = Effect.fn("desktop.observability.writeBackendChildLogRecord")(
363 function* (
364 logFile: RotatingLogFileWriter,
365 input: {
366 readonly message: string;
367 readonly level: "INFO" | "ERROR";
368 readonly annotations: Record<string, unknown>;
369 },
370 ): Effect.fn.Return<void> {
371 return yield* Effect.gen(function* () {
372 const timestamp = DateTime.formatIso(yield* DateTime.now);
373 const encoded = yield* encodeDesktopBackendChildLogRecord({
374 message: input.message,
375 level: input.level,
376 timestamp,
377 annotations: input.annotations,
378 spans: {},
379 fiberId: DESKTOP_BACKEND_CHILD_LOG_FIBER_ID,
380 });
381 yield* logFile.writeText(`${encoded}\n`);
382 }).pipe(Effect.ignore({ log: true }));
383 },
384);
385
386const PRIMARY_BACKEND_LOG_INSTANCE_ID = PRIMARY_LOCAL_ENVIRONMENT_ID;
387
388const sanitizeInstanceIdForFileName = (id: string): string => id.replace(/[^a-zA-Z0-9._-]+/g, "_");
389
390const backendLogFilePathForInstance = (
391 environment: DesktopEnvironment.DesktopEnvironment["Service"],
392 id: string,
393): string => {
394 // Primary keeps the historical "server-child.log" path so ops scripts
395 // and packaged-build log inspection still find it where it always lived.
396 if (id === PRIMARY_BACKEND_LOG_INSTANCE_ID) {
397 return environment.path.join(environment.logDir, "server-child.log");
398 }
399 const sanitized = sanitizeInstanceIdForFileName(id);
400 return environment.path.join(environment.logDir, `server-child-${sanitized}.log`);
401};
402
403// Just the IO sink. Cacheable by resolved file path so two ids that
404// sanitize to the same filename share a single RotatingLogFileWriter
405// (no race on currentSize tracking). Splitting the sink off from the
406// per-call shape lets the shape annotate writes with the *caller's*
407// id rather than whatever id created the cached writer first.
408const makeBackendOutputSinkForInstance = (
409 environment: DesktopEnvironment.DesktopEnvironment["Service"],
410 id: string,
411): Effect.Effect<
412 Option.Option<RotatingLogFileWriter>,
413 never,
414 FileSystem.FileSystem | Path.Path | Scope.Scope
415> =>
416 makeRotatingLogFileWriter({
417 filePath: backendLogFilePathForInstance(environment, id),
418 }).pipe(Effect.option);
419
420const makeBackendOutputLogShape = (
421 environment: DesktopEnvironment.DesktopEnvironment["Service"],
422 id: string,
423 sink: Option.Option<RotatingLogFileWriter>,
424): Effect.Effect<DesktopBackendOutputLogShape> =>
425 Option.match(sink, {
426 onNone: () => Effect.succeed(DesktopBackendOutputLogNoop),
427 onSome: (logFile) =>
428 Effect.gen(function* () {
429 const sessionRef = yield* Ref.make(Option.none<BackendOutputSession>());
430 const writeFailure = Effect.fn("desktop.observability.backendOutput.writeFailure")(
431 function* (session: BackendOutputSession, details: string) {
432 yield* writeBackendChildLogRecord(logFile, {
433 message: "backend child process failure output start",
434 level: "ERROR",
435 annotations: {
436 component: "desktop-backend-child",
437 runId: session.runId,
438 instanceId: id,
439 phase: "START",
440 details: session.startDetails,
441 },
442 });
443 for (const output of session.chunks) {
444 yield* writeBackendChildLogRecord(logFile, {
445 message: "backend child process output",
446 level: output.streamName === "stderr" ? "ERROR" : "INFO",
447 annotations: {
448 component: "desktop-backend-child",
449 runId: session.runId,
450 instanceId: id,
451 stream: output.streamName,
452 text: textDecoder.decode(output.chunk.subarray(output.offset)),
453 },
454 });
455 }
456 yield* writeBackendChildLogRecord(logFile, {
457 message: "backend child process failure output end",
458 level: "ERROR",
459 annotations: {
460 component: "desktop-backend-child",
461 runId: session.runId,
462 instanceId: id,
463 phase: "END",
464 details: sanitizeLogValue(details),
465 },
466 });
467 },
468 );
469 return {
470 beginSession: Effect.fn("desktop.observability.backendOutput.beginSession")(function* ({
471 details,
472 }) {
473 const runId = yield* currentDesktopRunId;
474 yield* Ref.set(
475 sessionRef,
476 Option.some({
477 runId,
478 startDetails: sanitizeLogValue(details),
479 chunks: [],
480 byteLength: 0,
481 }),
482 );
483 }),
484 writeOutputChunk: Effect.fnUntraced(function* (streamName, chunk) {
485 if (environment.isDevelopment) {
486 yield* writeDevelopmentConsoleOutput(streamName, chunk);
487 }
488 yield* Ref.update(
489 sessionRef,
490 Option.map((session) => appendBoundedOutputChunk(session, streamName, chunk)),
491 );
492 }),
493 persistFailureSnapshot: Effect.fn(
494 "desktop.observability.backendOutput.persistFailureSnapshot",
495 )(function* ({ details }) {
496 const session = yield* Ref.get(sessionRef);
497 if (Option.isSome(session)) {
498 yield* writeFailure(session.value, details);
499 }
500 }),
501 persistFailure: Effect.fn("desktop.observability.backendOutput.persistFailure")(
502 function* ({ details }) {
503 const session = yield* Ref.modify(sessionRef, (current) => [current, Option.none()]);
504 if (Option.isNone(session)) return;
505 yield* writeFailure(session.value, details);
506 },
507 ),
508 discardSession: Ref.set(sessionRef, Option.none()),
509 } satisfies DesktopBackendOutputLogShape;
510 }),
511 });
512
513const backendOutputLogFactoryLayer = Layer.effect(
514 DesktopBackendOutputLogFactory,
515 Effect.gen(function* () {
516 const environment = yield* DesktopEnvironment.DesktopEnvironment;
517 const fileSystem = yield* FileSystem.FileSystem;
518 const path = yield* Path.Path;
519 const factoryScope = yield* Scope.Scope;
520 // Per-file-path cache of the IO sink only. The per-call shape
521 // wraps the sink with the caller's instance id so a cache hit on
522 // a path collision (e.g. "wsl:default" and "wsl_default" both
523 // resolve to server-child-wsl_default.log) doesn't attribute the
524 // second caller's writes to the first caller's id. Each sink pins
525 // itself to the factory's scope so all log resources tear down
526 // together at app exit. Mutex serializes concurrent first-time
527 // lookups for the same file path.
528 const cacheRef = yield* SynchronizedRef.make<
529 ReadonlyMap<string, Option.Option<RotatingLogFileWriter>>
530 >(new Map());
531
532 const makeForId = (id: string): Effect.Effect<DesktopBackendOutputLogShape> =>
533 SynchronizedRef.modifyEffect(cacheRef, (cache) => {
534 const cacheKey = backendLogFilePathForInstance(environment, id);
535 const cached = cache.get(cacheKey);
536 if (cached !== undefined) {
537 return makeBackendOutputLogShape(environment, id, cached).pipe(
538 Effect.map((outputLog) => [outputLog, cache] as const),
539 );
540 }
541 return makeBackendOutputSinkForInstance(environment, id).pipe(
542 Effect.provideService(FileSystem.FileSystem, fileSystem),
543 Effect.provideService(Path.Path, path),
544 Scope.provide(factoryScope),
545 Effect.map((sink) => {
546 const next = new Map(cache);
547 next.set(cacheKey, sink);
548 return { sink, next };
549 }),
550 Effect.flatMap(({ sink, next }) =>
551 makeBackendOutputLogShape(environment, id, sink).pipe(
552 Effect.map(
553 (outputLog) =>
554 [
555 outputLog,
556 next as ReadonlyMap<string, Option.Option<RotatingLogFileWriter>>,
557 ] as const,
558 ),
559 ),
560 ),
561 );
562 });
563
564 return DesktopBackendOutputLogFactory.of({
565 forInstance: (id) => makeForId(id),
566 });
567 }),
568);
569
570const desktopLoggerLayer = Layer.mergeAll(
571 Logger.layer([Logger.consolePretty(), Logger.tracerLogger], { mergeWithExisting: false }),
572 Layer.succeed(References.MinimumLogLevel, "Info"),
573);
574
575const tracerLayer = Layer.unwrap(
576 Effect.gen(function* () {
577 const environment = yield* DesktopEnvironment.DesktopEnvironment;
578 const otlpTracesUrl = yield* resolveOtlpTracesUrl;
579 const tracePath = environment.path.join(environment.logDir, "desktop.trace.ndjson");
580 const sink = yield* makeTraceSink({
581 filePath: tracePath,
582 maxBytes: DESKTOP_LOG_FILE_MAX_BYTES,
583 maxFiles: DESKTOP_LOG_FILE_MAX_FILES,
584 batchWindowMs: DESKTOP_TRACE_BATCH_WINDOW_MS,
585 });
586 const delegate = Option.isNone(otlpTracesUrl)
587 ? undefined
588 : yield* OtlpTracer.make({
589 url: otlpTracesUrl.value,
590 exportInterval: `${environment.otlpExportIntervalMs} millis`,
591 headers: Option.getOrUndefined(environment.otlpHeaders),
592 resource: {
593 serviceName: "desktop",
594 attributes: {
595 "service.runtime": "desktop",
596 "service.mode": environment.isDevelopment ? "development" : "packaged",
597 },
598 },
599 }).pipe(Effect.provide(otlpSerializationLayer(environment.otlpProtocol)));
600 const tracer = yield* makeLocalFileTracer({
601 filePath: tracePath,
602 maxBytes: DESKTOP_LOG_FILE_MAX_BYTES,
603 maxFiles: DESKTOP_LOG_FILE_MAX_FILES,
604 batchWindowMs: DESKTOP_TRACE_BATCH_WINDOW_MS,
605 sink,
606 ...(delegate ? { delegate } : {}),
607 });
608
609 return Layer.succeed(Tracer.Tracer, tracer);
610 }),
611).pipe(Layer.provide(OtlpExporter.layerFlusher));
612
613export const layer = Layer.mergeAll(
614 backendOutputLogFactoryLayer,
615 desktopLoggerLayer,
616 tracerLayer,
617 Layer.succeed(Tracer.MinimumTraceLevel, "Info"),
618 Layer.succeed(References.TracerTimingEnabled, true),
619);