Documentation ¶
Index ¶
Constants ¶
const ( // This defines the default api root for incoming // log messages. API_ROOT_PATH = "/api/v1/logbooks" // seize of buffer for channels CHANNEL_BUFFER = 20 NUMBER_OF_DISPATCHERS = 1 )
const ( LogHeaderPrefix string = "LogBook" LogHeaderAppIdentifier string = LogHeaderPrefix + "-App-Identifier" LogHeaderLoggerName string = LogHeaderPrefix + "-Logger-Name" LogHeaderRequestUri string = LogHeaderPrefix + "-Request-URI" LogHeaderRequestId string = LogHeaderPrefix + "-Request-Id" )
Variables ¶
This section is empty.
Functions ¶
func ForceCookie ¶
Types ¶
type HeaderData ¶
Header data contain information about the origin of the message, like app and logger or the request uri
type IncomingMessage ¶
type IncomingMessage struct { Body LogMessageBody Origin HeaderData // contains filtered or unexported fields }
This the data structure for incoming messages. It consists of header data and the information in the http body.
Here our ontology is oriented at the technical prospective of http-requests
type LogBookApplication ¶
type LogBookApplication struct {
// contains filtered or unexported fields
}
This is the main backend application It contains the inbox and dispatcher and manages the processing of incoming log messages
func (*LogBookApplication) AddApplicationToEngine ¶
func (app *LogBookApplication) AddApplicationToEngine(engine *gin.Engine)
Use this function to register the LogBookAppliccation to a given GIN-engine. It will
* initialize inbox and dispatcher, * start the log inbox, and * start the LogBook API
type LogBookEntry ¶
type LogBookEntry struct { Application string `json:"application"` LoggerName string `json:"logger"` RequestUri string `json:"request_uri"` RequestId string `json:"request_id"` Timestamp int `json:"time"` Message string `json:"message"` Severity int `json:"severity"` SeverityText string `json:"severity_text"` // The Context will be eliminated in a future version // because it only affects the working of psr-compatible // loggers in PHP Context interface{} `json:"context"` // contains filtered or unexported fields }
The LogBook-entry is the transformed data object which contains data for the LogBook frontend.
Here we use the genuine LogBook-ontology
type LogMessageBody ¶
type LogMessageBody struct { Timestamp int `json:"time"` Message string `json:"message"` Severity interface{} `json:"severity"` // The context is not a natural part of // a log message in general, but only for // psr-loggers in PHP. This should therefore // be eliminated in the future Context interface{} `json:"context"` }
The body of the message is sent as a json object