Beego NewLogger channelLens value

64 Views Asked by At

Can someone help me understand the significance of channelLens value in Beego NewLogger function. The documentation says channelLen means the number of messages in chan(used where asynchronous is true). if the buffering chan is full, logger adapters write to file or other way. & Its not clear for me. Thanks in advance

1

There are 1 best solutions below

3
serge-v On

When you pass no parameter to NewLogger() it uses defaultAsyncMsgLen as internal channel size. This line: https://github.com/astaxie/beego/blob/v1.12.3/logs/log.go#L151

When you pass a parameter the logger uses it as internal channel size.