github.com/minio/madmin-go/v3@v3.0.51/api-log-entry.go (about)

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