github.com/minio/console@v1.4.1/pkg/logger/message/log/entry.go (about) 1 // This file is part of MinIO Console Server 2 // Copyright (c) 2022 MinIO, Inc. 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Affero General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Affero General Public License for more details. 13 // 14 // You should have received a copy of the GNU Affero General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 17 package log 18 19 import ( 20 "time" 21 ) 22 23 // ObjectVersion object version key/versionId 24 type ObjectVersion struct { 25 ObjectName string `json:"objectName"` 26 VersionID string `json:"versionId,omitempty"` 27 } 28 29 // Args - defines the arguments for the API. 30 type Args struct { 31 Bucket string `json:"bucket,omitempty"` 32 Object string `json:"object,omitempty"` 33 VersionID string `json:"versionId,omitempty"` 34 Objects []ObjectVersion `json:"objects,omitempty"` 35 Metadata map[string]string `json:"metadata,omitempty"` 36 } 37 38 // Trace - defines the trace. 39 type Trace struct { 40 Message string `json:"message,omitempty"` 41 Source []string `json:"source,omitempty"` 42 Variables map[string]interface{} `json:"variables,omitempty"` 43 } 44 45 // API - defines the api type and its args. 46 type API struct { 47 Name string `json:"name,omitempty"` 48 } 49 50 // Entry - defines fields and values of each log entry. 51 type Entry struct { 52 DeploymentID string `json:"deploymentid,omitempty"` 53 Level string `json:"level"` 54 LogKind string `json:"errKind"` 55 Time time.Time `json:"time"` 56 API *API `json:"api,omitempty"` 57 RemoteHost string `json:"remotehost,omitempty"` 58 Host string `json:"host,omitempty"` 59 RequestID string `json:"requestID,omitempty"` 60 SessionID string `json:"sessionID,omitempty"` 61 UserAgent string `json:"userAgent,omitempty"` 62 Message string `json:"message,omitempty"` 63 Trace *Trace `json:"errors,omitempty"` 64 }