You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Next |`func(fiber.Ctx) bool`| Next defines a function to skip this middleware when returned true. |`nil`|
142
-
| Skip |`func(fiber.Ctx) bool`| Skip is a function to determine if logging is skipped or written to Stream. |`nil`|
143
-
| Done |`func(fiber.Ctx, []byte)`| Done is a function that is called after the log string for a request is written to Stream, and pass the log string as parameter. |`nil`|
144
-
| CustomTags |`map[string]LogFunc`| tagFunctions defines the custom tag action. |`map[string]LogFunc`|
145
-
| Format |`string`| Format defines the logging tags. |`[${time}] ${ip} ${status} - ${latency} ${method} ${path} ${error}\n`|
146
-
| TimeFormat |`string`| TimeFormat defines the time format for log timestamps. |`15:04:05`|
147
-
| TimeZone |`string`| TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc |`"Local"`|
148
-
| TimeInterval |`time.Duration`| TimeInterval is the delay before the timestamp is updated. |`500 * time.Millisecond`|
149
-
| Stream |`io.Writer`| Stream is a writer where logs are written. |`os.Stdout`|
150
-
| LoggerFunc |`func(c fiber.Ctx, data *Data, cfg Config) error`| Custom logger function for integration with logging libraries (Zerolog, Zap, Logrus, etc). Defaults to Fiber's default logger if not defined. |`see default_logger.go defaultLoggerInstance`|
151
-
| DisableColors |`bool`| DisableColors defines if the logs output should be colorized. |`false`|
| Next |`func(fiber.Ctx) bool`| Next defines a function to skip this middleware when returned true.|`nil`|
159
+
| Skip |`func(fiber.Ctx) bool`| Skip is a function to determine if logging is skipped or written to Stream.|`nil`|
160
+
| Done |`func(fiber.Ctx, []byte)`| Done is a function that is called after the log string for a request is written to Stream, and pass the log string as parameter.|`nil`|
161
+
| CustomTags |`map[string]LogFunc`| tagFunctions defines the custom tag action.|`map[string]LogFunc`|
162
+
|`Format`|`string`| Defines the logging tags. See more in [Predefined Formats](#predefined-formats), or create your own using [Tags](#constants). |`[${time}] ${ip} ${status} - ${latency} ${method} ${path} ${error}\n` (same as `DefaultFormat`)|
163
+
| TimeFormat |`string`| TimeFormat defines the time format for log timestamps.|`15:04:05`|
164
+
| TimeZone |`string`| TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc|`"Local"`|
165
+
| TimeInterval |`time.Duration`| TimeInterval is the delay before the timestamp is updated.|`500 * time.Millisecond`|
166
+
| Stream |`io.Writer`| Stream is a writer where logs are written.|`os.Stdout`|
167
+
| LoggerFunc |`func(c fiber.Ctx, data *Data, cfg Config) error`| Custom logger function for integration with logging libraries (Zerolog, Zap, Logrus, etc). Defaults to Fiber's default logger if not defined. |`see default_logger.go defaultLoggerInstance`|
168
+
| DisableColors |`bool`| DisableColors defines if the logs output should be colorized.|`false`|
|`CommonFormat`|`"${ip} - - [${time}] "${method} ${url} ${protocol}" ${status} ${bytesSent}\n"`| Common Log Format (CLF) used in web server logs. |
196
+
|`CombinedFormat`|`"${ip} - - [${time}] "${method} ${url} ${protocol}" ${status} ${bytesSent} "${referer}" "${ua}"\n"`| CLF format plus the `referer` and `user agent` fields. |
197
+
|`JSONFormat`|`"{time: ${time}, ip: ${ip}, method: ${method}, url: ${url}, status: ${status}, bytesSent: ${bytesSent}}\n"`| JSON format for structured logging. |
198
+
|`ECSFormat`|`"{\"@timestamp\":\"${time}\",\"ecs\":{\"version\":\"1.6.0\"},\"client\":{\"ip\":\"${ip}\"},\"http\":{\"request\":{\"method\":\"${method}\",\"url\":\"${url}\",\"protocol\":\"${protocol}\"},\"response\":{\"status_code\":${status},\"body\":{\"bytes\":${bytesSent}}}},\"log\":{\"level\":\"INFO\",\"logger\":\"fiber\"},\"message\":\"${method} ${url} responded with ${status}\"}\n"`| Elastic Common Schema (ECS) format for structured logging. |
0 commit comments