stmcginnis / gofish

Gofish is a Golang client library for DMTF Redfish and SNIA Swordfish interaction.
BSD 3-Clause "New" or "Revised" License
224 stars 117 forks source link

how to get "warning" or "error" event logs #163

Closed dazhaoyu closed 2 years ago

dazhaoyu commented 2 years ago

hi @stmcginnis I want to get the hardware log information, but when I use logServices is return nil. can you give me some help on this issue? and how to just select the "error" event information, thanks!

stmcginnis commented 2 years ago

There are a few different LogServices, accessed via either ComputerSystem or Manager objects. From those instances you call something like computerSystem.LogServices() to get the associated services. I think most implementations only have one log service, but the protocol allows for multiple services.

You would iterate through the returned LogServices and call logService.Entries() to get the actually log entries. I don't believe there is a way to filter based on log level. You would get all LogEntry objects back and need to filter the results on the receiving end based on whatever criteria you have.