Use SEQ as a transport for winston logging of errors inside JSReport



  • The below describes how to use SEQ with nodeJS
    https://docs.datalust.co/docs/using-nodejs
    I was hoping to gain some insight into where to implement this with JSReport

    What I was thinking / have tried:

    • Option1: Inside server.js, create the Winston logger and add the new SeqTransport. Presumably this is then available to customize in jsreport.config.json and environmental variables.

    • Option 2: Do not use the NPM module and instead use the http transport in jsreport.config.json

    Something like:

    "logger": {
        "file": {
          "transport": "file",
          "level": "info",
          "filename": "logs/reporter.log"
        },
        "error": {
          "level": "error",
          "transport": "http",
          "host": "https://test-seq.com:5341&apiKey?xxx"
        }
      },
    

    Any thoughts or ideas would be much appreciated.



  • Install @datalust/winston-seq package

    npm install @datalust/winston-seq
    

    And edit jsreport.config.json

    "logger": {
        "seq": {
          "module": "@datalust/winston-seq",
          "transport": "SeqTransport",
          "level": "error",
          "serverUrl": "https://your-seq-server:5341",
          "apiKey": "your-api-key"
        }
      }
    

    I didn't test it with seq, but it throws some networking errors so I believe it will work when the URLs are right.

    This approach is described here for loggly transport.
    https://jsreport.net/learn/configuration#logging



  • Worked like a charm. Thanks for all the help!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.