Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no query params, no message #155

Open
tcurdt opened this issue Nov 21, 2023 · 3 comments
Open

no query params, no message #155

tcurdt opened this issue Nov 21, 2023 · 3 comments

Comments

@tcurdt
Copy link

tcurdt commented Nov 21, 2023

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
Copy link
Author

tcurdt commented Nov 21, 2023

Also tried:

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

@tcurdt
Copy link
Author

tcurdt commented Dec 4, 2023

Just a pointer would be great.

@tcurdt
Copy link
Author

tcurdt commented Dec 11, 2023

Is the project abandoned, @felixheck ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant