laabr icon indicating copy to clipboard operation
laabr copied to clipboard

no query params, no message

Open tcurdt opened this issue 7 months ago • 3 comments

When I use curl to make request to hapi I am getting this information:

curl -X DELETE -H "Authorization: Bearer $TOKEN" "http://localhost:9000/api/foo?blub=hufnefal"
{"statusCode":400,"error":"Bad Request","message":"failed to delete"}% 

The information I am after in the logs are

  1. 400
  2. blub=hufnefal
  3. failed to delete

But I am somehow not getting that information with

        {
          plugin: Laabr,
          options: {
            colored: true,
            formats: {
              response: ':time :method :url :status :payload (:responseTime ms)'
            }
          }
        }

and

  "dependencies": {
    ...
    "@hapi/hapi": "21.3.2",
    "joi": "17.11.0",
    "laabr": "6.1.3",
    ...
  },

I tried specifying message and I also tried specifying logQueryParams as suggested in #104 I would have thought this should do the trick:

        {
          plugin: Laabr,
          options: {
            colored: true,
            hapiPino: { logQueryParams: true },
            formats: {
              response: ':time :method :url :status :payload (:responseTime ms) :message'
            }
          }
        }

What am I missing?

tcurdt avatar Nov 21 '23 13:11 tcurdt

Also tried:

response: ':time :method :url :status :payload (:responseTime ms) :error[field=message]

tcurdt avatar Nov 21 '23 13:11 tcurdt

Just a pointer would be great.

tcurdt avatar Dec 04 '23 10:12 tcurdt

Is the project abandoned, @felixheck ?

tcurdt avatar Dec 11 '23 21:12 tcurdt