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

Basic Log Serializer has been deprecated #44

Closed
sherodtaylor opened this issue Aug 4, 2020 · 2 comments
Closed

Basic Log Serializer has been deprecated #44

sherodtaylor opened this issue Aug 4, 2020 · 2 comments

Comments

@sherodtaylor
Copy link

I'm trying to create a go plugin and it looks like pdk is complaining about using kong.log.serialize under the hood?

Kong version: 2.1 (beta)

2020/08/04 19:43:51 [notice] 65021#0: *26 [kong] go.lua:97 go-pluginserver terminated: exit 2, context: ngx.timer
2020/08/04 19:43:51 [notice] 65021#0: *26 [kong] go.lua:86 Starting go-pluginserver, context: ngx.timer
2020/08/04 19:43:51 [warn] 65021#0: *426 [kong] basic.lua:12 [guts] basic log serializer has been deprecated, please modify your plugin to use the kong.log.serialize PDK function instead while logging request, client: 127.0.0.1, server: kong, request: "POST /phoenix/api/0.1/rebuild HTTP/1.1", upstream: "https://10.34.1.201:443/api/0.1/rebuild", host: "localhost:8000"

package main

import (
  "github.com/Kong/go-pdk"
)

type Config struct {
  Path   string
  Reopen bool
}

func New() interface{} {
  return &Config{}
}



func (conf Config) Access(kong *pdk.PDK) {
  // after request has been sent stop timer with correct tags
  uuid, err := kong.Request.GetHeader("Kong-Request-ID")
  if err != nil {
    kong.Log.Info("[Request]: error receiving request id", uuid)
  }
}

func (conf Config) Log(kong *pdk.PDK) {
  uuid, err := kong.Request.GetHeader("Kong-Request-ID")
  if err != nil {
    kong.Log.Err("[Response]: error receiving request id", uuid)
  }
}


@fffonion
Copy link
Contributor

@gszr does it get covered by your recent work about serialzation improvement?

@fffonion
Copy link
Contributor

Can confirm this is fixed in at least Kong 2.3, please reopen if issue still exists.

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

2 participants