Skip to content

Add connection ID to track requests and responses in log#51

Open
droscy wants to merge 1 commit intotiagocoutinho:masterfrom
droscy:feat/connection-id
Open

Add connection ID to track requests and responses in log#51
droscy wants to merge 1 commit intotiagocoutinho:masterfrom
droscy:feat/connection-id

Conversation

@droscy
Copy link
Copy Markdown

@droscy droscy commented Oct 1, 2025

Having more than one device in config file, it was hard for me to track which clients communicate with which device, so I added a simple ID to the name of each connection in order the have that ID printed in every line of log. The ID is derived from url of modbus device.

INFO modbus-proxy.ModBus(192.168.0.10:502, 8ce6dd): Ready to accept requests on 0:11120
INFO modbus-proxy.ModBus(192.168.0.11:502, a633f1): Ready to accept requests on 0:11121
INFO modbus-proxy.Client(127.0.0.1:57240, 8ce6dd): new client connection
DEBUG modbus-proxy.Client(127.0.0.1:57240, 8ce6dd): received b'\x96\xac\x00\x00\x00\x06\x01\x03\x9c\x87\x00&'
INFO modbus-proxy.ModBus(192.168.0.10:502, 8ce6dd): connecting to modbus...
INFO modbus-proxy.ModBus(192.168.0.10:502, 8ce6dd): connected!
INFO modbus-proxy.ModBus(192.168.0.10:502, 8ce6dd): delay after connect: 0.5
INFO modbus-proxy.Client(127.0.0.1:43987, a633f1): new client connection
DEBUG modbus-proxy.Client(127.0.0.1:43987, a633f1): received b'\x96\xac\x00\x00\x00\x06\x01\x03\x9c\x87\x00&'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant