Closed pilotso11 closed 1 year ago
Hi, I appreciate the PR. Your integration of zap into FIX logging I'm sure would be quite useful, however, I'm not positive I want to support zap integration out-of-the-box with this project and add all the zap deps. Rather, I'd leave it up to users to implement the FIX logging interface however they wish, including any log pkg they want. In the future I hope to have some FIX logging examples in a demo repo - I'll refer back to this + credit you at that time! Closing this for now.
ZAP logger for quickfix
To use:
Uses ZAP (https://pkg.go.dev/go.uber.org/zap), a very low latency logger for golang which supports:
This wrapper passes all the quickfix logging directly to zap at
INFO
level.It sets a named logger for each session with
Prefix+Sender:Target
as the label. Setting prefix to""
results in the message being labeled with just the sender and target.For example if the Sender is
SEND
and the target isTARG
and the prefix isFIX_
then the name will beFIX_SEND:TARG
.There is also an option to enable or disable detailed message logging. If message logging is enabled,
EOM
field separators are replaced with|
for readability.With no prefix you will see log messages similar to this using console/debug logging.
And with json logging
Tests have been added. Unfortunately without completely mocking the logger it is difficult to test the actual logging functions, but as they are passthroughs to ZAP there are unlikely to be any regression errors in this factory and logger.
Possible future improvements: