1

I'm trying to use SocketAppender to log events to a socket server.

The thing I need to send is a custom log object. However it seems as if all the objects are sent as Strings using toString.

Read about it here:

Anyone know how to deal with this? Any suggestions?

Do I have to parse the String and build the object on the server? I am using Logback so that I can add other appenders than the SocketAppender.

4

1 回答 1

0

我的建议是:

  • 使用fastjson将您的对象转换为 json 字符串;
  • 将 json 字符串传递给 logback 函数调用;
  • 解析字符串并在服务器上重建对象;
于 2013-03-08T01:32:51.043 回答