日志服务使用Protocol Buffer格式作为标准的日志写入格式。
Protocol Buffer格式用于结构化数据交换格式,当用户需要写入日志时,需要把原始日志数据序列化成如下格式的Protocol Buffer数据流,然后才能通过API写入服务端。
message Log
{
    required uint32 Time = 1;// UNIX Time Format
    message Content
    {
        required string Key = 1;
        required string Value = 2;
    }  
    repeated Content Contents = 2;
    optional fixed32 Time_ns = 4; // for time nano part
}
message LogTag
{
    required string Key = 1;
    required string Value = 2;
}
message LogGroup
{
    repeated Log Logs= 1;
    optional string Topic = 3;
    optional string Source = 4;
    repeated LogTag LogTags = 6;
}
message LogGroupList
{
    repeated LogGroup logGroupList = 1;
}该文章对您有帮助吗?