Need help to access kong.ctx.shared from a custom plugin

Hi all,

I need a little help to transfer values from one plugin (CustomPlugin) to another plugin (TCP Log Plugin) to extend the logging with custom attributes.

I wrote a CustomPlugin (see listing) where I try to set a value in kong.ctx.shared.myvalue as I understood from the documentation that this is the preferred way to hand over data from one to another plugin.

local BasePlugin = require "kong.plugins.base_plugin" 
local CustomHandler = BasePlugin:extend()

local kong = kong

CustomHandler.PRIORITY = 15
CustomHandler.VERSION = "1.0.0"

function CustomHandler:log(conf)
  kong.ctx.shared.myvalue = true
end

return CustomHandler

Unfortunately, when I try to access the data from the TCP Log Plugin via kong.ctx.shared.myvalue, it is nil.

Can anybody help me out? Thank you very much in advance.

Best regards,
Philipp

Make sure the priorities are correct and this plugin is executed before the TCP log plugin.