Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // DatabasePath define the location where the sqlite database wil be stored // // Optional. Default: ./logs.sqlite DatabasePath string // WorkerBufferSize define the size of the worker buffer // // Optional. Default: 100 WorkerBufferSize int // Path define the the base path to the logs view // (it is recommended to use a path that is not publicly accessible) // (e.g. /logs or /admin/logs) // // If set manually, it is recommended to also set the ExcludeRoutes and ExcludePatterns // // Optional. Default: /logs Path string // ExcludePaths define the paths to exclude from logging // // Optional. Default: ["logs", "/favicon.ico"] ExcludeRoutes []string // ExcludePaths define the paths to exclude from logging // // Optional. Default: ["/logs/*"] ExcludePatterns []string // ExcludePAram define a parameter that will exclude the request from logging // // Optional. Default: "" ExcludeParam string // LogDetailMember define the member name that will be used to store the log details in the fiber.Ctx local // // Optional. Default: "logDetail" LogDetailMember string // SecureByPassword define if the logs view should be secured by a password // // Optional. Default: true SecureByPassword *bool // Password define the password to secure the logs view // (it is recommended to store it in an environment variable) // // Optional. Default: "password" Password string // JwtSecret define the secret to sign the JWT token // (it is recommended to store it in an environment variable) // // Optional. Default: "secret" JwtSecret string // JwtExpireTime define the expiration time of the JWT token in seconds // // Optional. Default: 3600 // (1 hour) JwtExpireTime int64 // Theme define the theme of the logs view // // Optional. Default: "dark" Theme string // JwtSigningMethod define the signing method to use for the JWT token // // Optional. Default: jwt.SigningMethodHS256 JwtSigningMethod jwt.SigningMethod // AuthTokenCookieName define the name of the cookie that will be used to store the JWT token // // Optional. Default: "auth_token" AuthTokenCookieName string // IncludeLogPageConnexion define if the connexion via password to the logs page should be logged // // Optional. Default: true IncludeLogPageConnexion *bool }
Config define the configuration for the logger middleware
It is recommended to use the default configuration and override only the values you need
type LogEntry ¶
type LogEntry struct { ID int64 `db:"id" json:"id"` IPAddress string `db:"ip_address" json:"ip_address"` Url string `db:"url" json:"url"` Action string `db:"action" json:"action"` Details *string `db:"details" json:"details,omitempty"` // nullable, omis si nil Timestamp time.Time `db:"timestamp" json:"timestamp"` UserAgent *string `db:"user_agent" json:"user_agent,omitempty"` // nullable, omis si nil Status *string `db:"status" json:"status,omitempty"` // nullable, omis si nil Latency int64 `db:"latency" json:"latency"` }
func GetAllLogs ¶
func GetLogById ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.