pcdshub / lcls-twincat-general

A PLC code toolkit for LCLS TwinCAT PLC projects
https://pcdshub.github.io/lcls-twincat-general/
Other
16 stars 20 forks source link

MNT: Added optics logging enum #41

Closed jsheppard95 closed 4 years ago

jsheppard95 commented 4 years ago

Very simple PR, just adding OPTICS to E_Subsystem.TcDUT, as I believe I heard in a recent EnGen that this is necessary for my PLC's log messages to be captured in ctl-logsrv. Are there any other places that Optics needs to be added to in order to enable logging?

jsheppard95 commented 4 years ago

@ZLLentz Oh maybe there is something I am missing here. I thought this PR was necessary to enable any type of logging from the Optics PLCs with the new logging system.

So I added FB_LogHandler to my PLC project, but when I run this command from psdev (which I got from @n-wbrown), I get the following:

$ curl -X GET "http://ctl-logsrv:9200/_search?q=log.subsytem:OPTICS&pretty"
{
  "took" : 7,
  "timed_out" : false,
  "_shards" : {
    "total" : 91,
    "successful" : 91,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}

@klauer I'll make that change, but thoughts on this? Is this the route to make the search term OPTICS meaningful?

klauer commented 4 years ago

Without my suggestion, your message won't show up as the "optics" subsystem in grafana / your curl request. Add it, and that should be rectified.