hapijs / hapi-pino

🌲 Hapi plugin for the Pino logger
MIT License
148 stars 61 forks source link

Streamed data not coming as json object #134

Closed fcesgpfedef closed 3 years ago

fcesgpfedef commented 3 years ago

Hi ,

I am using stream option in hapi-pino. Default process.stdout is coming as

[1614099855531] INFO (22328 on IN-5CG032847Y): request completed
    req: {
      "id": "1614099855495:IN-5CG032847Y:22328:kli9djsj:10000",
      "method": "post",
      "url": "/postone",
      "headers": {
        "content-type": "application/json",
        "user-agent": "PostmanRuntime/7.26.8",
        "accept": "*/*",
        "postman-token": "b3b277fd-8f80-44ff-bd46-ec34dae56519",
        "host": "localhost:3000",
        "accept-encoding": "gzip, deflate, br",
        "connection": "keep-alive",
        "content-length": "14"
      },
      "remoteAddress": "127.0.0.1",
      "remotePort": 63826
    }
    res: {
      "statusCode": 200,
      "headers": {
        "content-type": "application/json; charset=utf-8",
        "cache-control": "no-cache",
        "content-length": 21
      }
    }
    responseTime: 36

Is it possible to make hapi-pino not to send this piece of log [1614099855531] INFO (22328 on IN-5CG032847Y): request completed so that i can parse the rest of the data to json and perform my logic

mcollina commented 3 years ago

Could you please add a full example to reproduce?

fcesgpfedef commented 3 years ago

Hey, I just need to make prettyPrint option as false