File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
packages/web/docs/src/content Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -519,6 +519,35 @@ $ LOG_JSON_PRETTY=1 node example.js
519
519
Hive Logger includes some writers for common loggers of the JavaScript ecosystem with optional peer
520
520
dependencies.
521
521
522
+ # ### `LogTapeLogWriter`
523
+
524
+ Use the [` LogTape` logger library](https://logtape.org/) for writing Hive Logger' s logs.
525
+
526
+ `@logtape/logtape` is an optional peer dependency, so you must install it first.
527
+
528
+ ```sh npm2yarn
529
+ npm i @logtape/logtape
530
+ ```
531
+
532
+ ```ts
533
+ import { Logger } from ' @graphql-hive/logger'
534
+ import { LogTapeLogWriter } from ' @graphql-hive/logger/writers/logtape'
535
+ import { configure, getConsoleSink } from ' @logtape/logtape'
536
+
537
+ await configure({
538
+ sinks: { console: getConsoleSink() },
539
+ loggers: [{ category: ' hive-gateway' , sinks: [' console' ] }]
540
+ })
541
+
542
+ const log = new Logger({ writers: [new LogTapeLogWriter()] })
543
+
544
+ log.info({ some: ' attributes' }, ' hello world' )
545
+ ```
546
+
547
+ ```sh
548
+ 14:00:00.000 INF hive-gateway hello world
549
+ ```
550
+
522
551
#### `PinoLogWriter` (Node.js Only)
523
552
524
553
Use the [Node.js `pino` logger library](https://github.com/pinojs/pino) for writing Hive Logger' s
You can’t perform that action at this time.
0 commit comments