lorabasics / basicstation

LoRa Basics™ Station - The LoRaWAN Gateway Software
https://doc.sm.tc/station
Other
358 stars 183 forks source link

Structured logs or parsable format #117

Open mrpher opened 3 years ago

mrpher commented 3 years ago

I've been looking for a way to parse Stations logs so that I can generate some metrics from Station itself without relying on the NS to do it. I haven't been able to crack the code unfortunately.

2021-07-20 01:06:36.865 [S2E:VERB] RX 905.3MHz DR3 SF7/BW125 snr=8.2 rssi=-99 xtime=0x8F00672328D464 - updf mhdr=40 DevAddr=ABCDEFG FCtrl=80 FCnt=521 FOpts=[] 0ADBCA98..B0D8 mic=-1064057439 (25 bytes)

2021-07-20 01:06:37.854 [S2E:INFO] TX ::0 diid=4595 [ant#0] - on air: 927.5MHz 30.0dBm ant#0(0) DR13 SF7/BW500 frame=603EF49C01819700060FBF0B5F

First, are these logs in a particular, known format? It doesnt appear to be logfmt and using a regex to decipher so far has been intimidating to say the least.

Second, can we get a future release to output structured, parsable json logs? There's a lot of useful data in there but its hard to get at beyond in any scalable way. Maybe make it a config option in station.conf to encode to json?

beitler commented 2 years ago

Thank you for your suggestion.

The main purpose of the station logs is manual inspection for trouble shooting. The assumption so far has been that the logs don't leave the host platform's file system. For now, station does not support a way to stream the log data in structure form to various places. However, this is indeed a valid point that you are making and it may be considered in the future.

smtc-bot commented 2 years ago

Thank you for your inquiry.

Customers are encouraged to submit technical questions via our dedicated support portal at https://semtech.force.com/ldp/ldp_support.

We invite all users to visit the LoRa Developer Portal Forum at https://forum.lora-developers.semtech.com and to join the thriving LoRa development community!