简体   繁体   中英

How to read Netty Logs

I was wondering what this

  • [nioEventLoopGroup-2-2]
  • [nioEventLoopGroup-2-3]
  • [nioEventLoopGroup-5-2]

means in netty logs (the numbers). Is It something related to threads ?

Yes. The naming schema is

poolName + '-' + poolId.incrementAndGet() + '-' + nextId.incrementAndGet();

Where poolName is the class, poolId is a global counter, and nextId is per pool.

So nioEventLoopGroup-2-2 and nioEventLoopGroup-2-3 are the 2nd and 3rd thread from the 2nd pool, and nioEventLoopGroup-5-2 is the 2nd thread from some other pool.

src: https://github.com/netty/netty/blob/4.0/common/src/main/java/io/netty/util/concurrent/DefaultThreadFactory.java#L94

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM