github.com/minio/madmin-go@v1.7.5/api-log-entry.go (about)

     1  //
     2  // MinIO Object Storage (c) 2021 MinIO, Inc.
     3  //
     4  // Licensed under the Apache License, Version 2.0 (the "License");
     5  // you may not use this file except in compliance with the License.
     6  // You may obtain a copy of the License at
     7  //
     8  //      http://www.apache.org/licenses/LICENSE-2.0
     9  //
    10  // Unless required by applicable law or agreed to in writing, software
    11  // distributed under the License is distributed on an "AS IS" BASIS,
    12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  // See the License for the specific language governing permissions and
    14  // limitations under the License.
    15  //
    16  
    17  package madmin
    18  
    19  // Args - defines the arguments for the API.
    20  type logArgs struct {
    21  	Bucket   string            `json:"bucket,omitempty"`
    22  	Object   string            `json:"object,omitempty"`
    23  	Metadata map[string]string `json:"metadata,omitempty"`
    24  }
    25  
    26  // Trace - defines the trace.
    27  type logTrace struct {
    28  	Message   string            `json:"message,omitempty"`
    29  	Source    []string          `json:"source,omitempty"`
    30  	Variables map[string]string `json:"variables,omitempty"`
    31  }
    32  
    33  // API - defines the api type and its args.
    34  type logAPI struct {
    35  	Name string   `json:"name,omitempty"`
    36  	Args *logArgs `json:"args,omitempty"`
    37  }
    38  
    39  // Entry - defines fields and values of each log entry.
    40  type logEntry struct {
    41  	DeploymentID string    `json:"deploymentid,omitempty"`
    42  	Level        string    `json:"level"`
    43  	LogKind      LogKind   `json:"errKind"`
    44  	Time         string    `json:"time"`
    45  	API          *logAPI   `json:"api,omitempty"`
    46  	RemoteHost   string    `json:"remotehost,omitempty"`
    47  	Host         string    `json:"host,omitempty"`
    48  	RequestID    string    `json:"requestID,omitempty"`
    49  	UserAgent    string    `json:"userAgent,omitempty"`
    50  	Message      string    `json:"message,omitempty"`
    51  	Trace        *logTrace `json:"error,omitempty"`
    52  }