Logan
Logan copied to clipboard
日志解析报错
2020-12-18 16:06:59,732 ERROR [com.meituan.logan.web.parser.LoganProtocol] - java.io.EOFException: Unexpected end of ZLIB input stream, 2020-12-18 16:06:59,734 ERROR [com.meituan.logan.web.service.impl.LoganLogFileServiceDefaultImpl] - java.nio.BufferUnderflowException
安卓,ios上传的日志解析的时候都有一定概率,报该错误,问题出在哪里,有人遇到了吗
有一定概率压缩结束符没写入,建议在app到前后台切换的时候调一下flush
即使调用flush,理论上也无法从根本上杜绝结束符未写入问题吧?例如写入过程中app crash或者被系统回收。
是否可以考虑在Server的parser类中遇到开始符和结束符缺失的情况发生时,自动查找下一个开始或结束符? 或者是本地上传时进行一下开始符和结束符缺失检查。
private static byte[] decompress(byte[] contentBytes) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)), out); return out.toByteArray(); } catch (IOException e) { LOGGER.error(e.toString()); } return new byte[0]; }
2021-01-19 22:12:02.627 ERROR 9066 --- [nio-9903-exec-1] c.m.l.w.s.impl.LoganTaskServiceImpl : java.io.EOFException: Unexpected end of ZLIB input stream
断点这个解析异常,有遇到吗?
报的就是这个错误,安卓端修改了就正常了
在 2021-01-19 22:52:17,"强哥" [email protected] 写道:
private static byte[] decompress(byte[] contentBytes) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)), out); return out.toByteArray(); } catch (IOException e) { LOGGER.error(e.toString()); } return new byte[0]; }
2021-01-19 22:12:02.627 ERROR 9066 --- [nio-9903-exec-1] c.m.l.w.s.impl.LoganTaskServiceImpl : java.io.EOFException: Unexpected end of ZLIB input stream
断点这个解析异常,有遇到吗?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我也遇到了这个错误,困扰了我好久了,跪求大神给出解决方案
我也遇到了这个错误,困扰了我好久了,跪求大神给出解决方案
app切到后台的时候调一下flush
这个错误客户端flush感觉没有解决根本原因,应该后端catch住,能解析多少解析多少.
@Richard-Cao 你好,请问有Logan相关的微信群吗?
这个错误客户端flush感觉没有解决根本原因,应该后端catch住,能解析多少解析多少.
@Richard-Cao 你好,请问有Logan相关的微信群吗?
有的,你加我我拉你一下
#466 服务端做了兜底,可以升级下服务端最新代码