diff --git a/devices/common/lofar_logging.py b/devices/common/lofar_logging.py index 07f7f64e95819d2278ca0feb29ee2a28900b3012..826e484e6e2bd321c343b814ccb734472e8bf73c 100644 --- a/devices/common/lofar_logging.py +++ b/devices/common/lofar_logging.py @@ -94,6 +94,9 @@ class LogAnnotator(logging.Formatter): # annotate record with currently executing Tango device, if any record.tango_device = self.get_current_tango_device() + # construct an identifier we can add for other devices as well + record.lofar_id = f"tango - {record.tango_device}" + # annotate record with the current software version record.software_version = get_version() diff --git a/docs/source/interfaces/logs.rst b/docs/source/interfaces/logs.rst index 2b5c605ec5e47cf8b98b09dba47f6e6954f468ba..960efcd95b5306ab1904ffd8519e36af85099f0f 100644 --- a/docs/source/interfaces/logs.rst +++ b/docs/source/interfaces/logs.rst @@ -19,7 +19,7 @@ To monitor the logs remotely, or to browse older logs, use the *ELK stack* that If you browse to the ELK stack (actually, it is Kibana providing the GUI), your go-to is the *Discover* view at http://localhost:5601/app/discover. There, you can construct (and save, load) a dashboard that provides a custom view of the logs, based on the *index pattern* ``logstash-*``. There is a lot to take in, and there are excellent Kibana tutorials on the web. -To get going, use for example `this dashboard <http://localhost:5601/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-60m,to:now))&_a=(columns:!(extra.tango_device,level,message),filters:!(),index:'1e8ca200-1be0-11ec-a85f-b97e4206c18b',interval:auto,query:(language:kuery,query:''),sort:!())>`_, which shows the logs of the last hour, with some useful columns added to the default timestamp and message columns. Expand the time range if no logs appear, to look further back. You should see something like: +To get going, use for example `this dashboard <http://localhost:5601/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-60m,to:now))&_a=(columns:!(extra.lofar_id,level,message),filters:!(),index:'1e8ca200-1be0-11ec-a85f-b97e4206c18b',interval:auto,query:(language:kuery,query:''),sort:!())>`_, which shows the logs of the last hour, with some useful columns added to the default timestamp and message columns. Expand the time range if no logs appear, to look further back. You should see something like: .. image:: elk_last_hour.png