M
M
Mark Adams2019-02-23 03:26:42
Node.js
Mark Adams, 2019-02-23 03:26:42

How to parallelize logging in bunyan?

I use bunyan to output logs to a file and PostgreSQL.
The problem is that I can't write logs to the file and to the database at the same time through one Logger.
With these settings, everything is written to a file without any problems:

"optLogger2": {
    "name": "myapp",
    "streams": [
      {
          "path": "./logs.json"

      }
    ]
  }

But if you add from the example,
stream: ringbuffer
then the recording to the file stops and only the recording goes to the buffer, from which I pull out the json for the database.
Is it possible to somehow receive json without a buffer or set up recording to a file and buffer through one Logger?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question