Closed eikowagenknecht closed 3 years ago
Right now mbusd doesn't have an option to log request/responses only, but you could use -L-
option to enable logging to stdout and then use filtering. Something like this:
mbusd -p /dev/ttyUSB0 -s 9600 -P 502 -d -v5 -L- | grep "request:\|response:" > log.txt
Thanks for the workaround, that will do the trick for now :-)
I'm currently experiencing a strange phenomena where one of my modbus devices "automatically" turns itself on. To investigate this further, my idea was to set the logging level in mbusd so that I can see what is sent to the device and when.
I discovered that up lo loglevel 4 sending does not create any log entries, in level 5 it begins to log the request but also very much information that I don't need like all read requests (which happen every 5 seconds) and lots of entries regarding the connection state, so there is very much data written. Logging the response needs an even higher loglevel.
This is currently logged for every command I send (21 lines):
This would be the information I'd like to log:
Is there a possibility to achieve a log like this without generating tens of thousands of lines of logs?