Class WebsocketLogUtil

java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.websocket.WebsocketLogUtil

public class WebsocketLogUtil extends Object
This class will be used log the websocket communication related requests/frames between client and the gateway.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    printHeaders(org.apache.commons.logging.Log log, io.netty.handler.codec.http.FullHttpRequest msg, io.netty.channel.ChannelHandlerContext ctx)
    Print the headers associated with the initial Http Request.
    static void
    printSpecificLog(org.apache.commons.logging.Log log, io.netty.channel.ChannelHandlerContext ctx, String message)
    Print specific debug logs with the ChannelHandlerContext context.
    static void
    printWebSocketFrame(org.apache.commons.logging.Log log, io.netty.handler.codec.http.websocketx.WebSocketFrame frame, io.netty.channel.ChannelHandlerContext ctx, boolean isInbound)
    Print WebSocketFrame information.
    static void
    printWebSocketFrame(org.apache.commons.logging.Log log, io.netty.handler.codec.http.websocketx.WebSocketFrame frame, io.netty.channel.ChannelHandlerContext ctx, String customMsg, boolean isInbound)
    Print WebSocketFrame information.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WebsocketLogUtil

      public WebsocketLogUtil()
  • Method Details

    • printHeaders

      public static void printHeaders(org.apache.commons.logging.Log log, io.netty.handler.codec.http.FullHttpRequest msg, io.netty.channel.ChannelHandlerContext ctx)
      Print the headers associated with the initial Http Request. The header details will be printed in the following format.

      " >> Headers [channelContextId] [header name] : [header value]"

      Parameters:
      log - Log object of the relevant class
      msg - FullHttpRequest response from the backend
      ctx - ChannelHandlerContext context
    • printWebSocketFrame

      public static void printWebSocketFrame(org.apache.commons.logging.Log log, io.netty.handler.codec.http.websocketx.WebSocketFrame frame, io.netty.channel.ChannelHandlerContext ctx, String customMsg, boolean isInbound)
      Print WebSocketFrame information.
      Parameters:
      log - Log object of the relevant class
      frame - WebSocketFrame frame
      ctx - ChannelHandlerContext context
      customMsg - Custom message along with the frame information
      isInbound - true if the frame is inbound, false if it is outbound
    • printWebSocketFrame

      public static void printWebSocketFrame(org.apache.commons.logging.Log log, io.netty.handler.codec.http.websocketx.WebSocketFrame frame, io.netty.channel.ChannelHandlerContext ctx, boolean isInbound)
      Print WebSocketFrame information.
      Parameters:
      log - Log object of the relevant class
      frame - WebSocketFrame frame
      ctx - ChannelHandlerContext context
      isInbound - true if the frame is inbound, false if it is outbound
    • printSpecificLog

      public static void printSpecificLog(org.apache.commons.logging.Log log, io.netty.channel.ChannelHandlerContext ctx, String message)
      Print specific debug logs with the ChannelHandlerContext context.
      Parameters:
      log - log Log object of the relevant class
      ctx - ChannelHandlerContext context
      message - Log message