# README
Using the logging client
package main
import (
"net/http"
"fmt"
"time"
"github.com/philips-software/go-hsdp-api/logging"
)
func main() {
client, err := logging.NewClient(http.DefaultClient, &logging.Config{
SharedKey: "YourSharedKeyHere=",
SharedSecret: "YourSharedSecretHere==",
BaseURL: "https://logingestor-xx.host.com",
ProductKey: "product-akey-4bf2-9f2c-herec37ffake",
})
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
var logResource = logging.Resource{
ID: "856b1142-6df5-4c84-b11d-da3f0a794e84",
EventID: "1",
Category: "ApplicationLog",
Component: "TestApp",
TransactionID: "1f12f95c-77a0-48da-835d-e95aa116198f", // traceability
ServiceName: "TestApp",
ApplicationInstance: "7248e79e-ba0b-4d0e-82a9-fb7a47d26c23",
OriginatingUser: "729e83bb-ce7d-4052-92f8-077a376d774c",
Severity: "Info",
LogTime: time.Now().Format("2006-01-02T15:04:05.000Z07:00"),
LogData: logging.LogData{
Message: "Test log message",
},
}
_, err = client.StoreResources([]logging.Resource{ logResource }, 1)
if err != nil {
fmt.Printf("Batch flushing failed: %v\n", err)
}
}
Issues
- If you have an issue: report it on the issue tracker
Author
Andy Lo-A-Foe ([email protected])
License
License is MIT. See LICENSE file
# Functions
NewClient returns an instance of the logger client with the given Config.
# Constants
TimeFormat is the time format used for the LogTime field.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Bundle is a FHIR bundle resource There is just enough there to create the logging payload.
Client holds the client state.
Config the client.
Element is a FHIR element resource.
ErrorResponse holds an error response from the server.
LogData is the payload of a log message.
Resource is a logging resource.
StoreResponse holds a LogEvent response.
# Interfaces
Storer defines the store operations for logging.
# Type aliases
CustomIndexBody describes the custom index request payload.