diff --git a/.github/README.md b/.github/README.md index 86e1e0d7..8eab20fd 100644 --- a/.github/README.md +++ b/.github/README.md @@ -528,7 +528,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [ansrivas/fiberprometheus](https://github.com/ansrivas/fiberprometheus) - [LdDl/fiber-long-poll](https://github.com/LdDl/fiber-long-poll) diff --git a/.github/README_de.md b/.github/README_de.md index a2f77113..877a4087 100644 --- a/.github/README_de.md +++ b/.github/README_de.md @@ -524,7 +524,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_es.md b/.github/README_es.md index 5cae95b1..a178170d 100644 --- a/.github/README_es.md +++ b/.github/README_es.md @@ -104,10 +104,9 @@ Estas pruebas son realizadas por [TechEmpower](https://www.techempower.com/bench

## ⚙️ Instalación +Asegúrese de tener instalado Go ([download](https://golang.org/dl/)). Version `1.14` o superior. -Make sure you have Go installed ([download](https://golang.org/dl/)). Version `1.14` or higher is required. - -Initialize your project by creating a folder and then running `go mod init github.com/your/repo` ([learn more](https://blog.golang.org/using-go-modules)) inside the folder. Then install Fiber with the [`go get`](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) command: +Arranque su proyecto creando una nueva carpeta y ejecutando `go mod init github.com/your/repo` ([mas información](https://blog.golang.org/using-go-modules)) dentro de la misma carpeta. Después instale Fiber mediante el comando [`go get`](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them): ```bash go get -u github.com/gofiber/fiber/v2 @@ -138,8 +137,6 @@ Fiber está **inspirado** en Expressjs, el framework web más popular en Interne A continuación se enumeran algunos de los ejemplos comunes. Si desea ver más ejemplos de código, visite nuestro [repositorio de Recetas](https://github.com/gofiber/recipes) o nuestra [documentación de API](https://docs.gofiber.io) . -Listed below are some of the common examples. If you want to see more code examples , please visit our [Recipes repository](https://github.com/gofiber/recipes) or visit our hosted [API documentation](https://docs.gofiber.io). - #### 📖 [**Basic Routing**](https://docs.gofiber.io/#basic-routing) ```go @@ -524,7 +521,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_fr.md b/.github/README_fr.md index 24e33123..3cf5668d 100644 --- a/.github/README_fr.md +++ b/.github/README_fr.md @@ -524,7 +524,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_he.md b/.github/README_he.md index 45b48ab6..297324af 100644 --- a/.github/README_he.md +++ b/.github/README_he.md @@ -654,7 +654,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_id.md b/.github/README_id.md index 1e253ae0..0ffa1526 100644 --- a/.github/README_id.md +++ b/.github/README_id.md @@ -524,7 +524,7 @@ Berikut adalah kumpulan _middlewares_ yang dibuat oleh komunitas Fiber, silahkan - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_ja.md b/.github/README_ja.md index 70c92e7a..6e7b8db1 100644 --- a/.github/README_ja.md +++ b/.github/README_ja.md @@ -528,7 +528,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_ko.md b/.github/README_ko.md index ef1dfefd..97cd87da 100644 --- a/.github/README_ko.md +++ b/.github/README_ko.md @@ -528,7 +528,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_nl.md b/.github/README_nl.md index 8787ef18..8c3a9c65 100644 --- a/.github/README_nl.md +++ b/.github/README_nl.md @@ -528,7 +528,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_pt.md b/.github/README_pt.md index 6e21943e..e50d3fe1 100644 --- a/.github/README_pt.md +++ b/.github/README_pt.md @@ -522,7 +522,7 @@ Esta é uma lista de middlewares criados pela comunidade do Fiber, se quiser ter - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_ru.md b/.github/README_ru.md index d85ce038..e5704c93 100644 --- a/.github/README_ru.md +++ b/.github/README_ru.md @@ -526,7 +526,7 @@ List of externally hosted middleware modules and maintained by the [Fiber team]( - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_sa.md b/.github/README_sa.md index 36d22b64..a7cb325c 100644 --- a/.github/README_sa.md +++ b/.github/README_sa.md @@ -580,7 +580,7 @@ List of externally hosted middleware modules and maintained by the [Fiber team]( - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_tr.md b/.github/README_tr.md index 34e43387..0a772366 100644 --- a/.github/README_tr.md +++ b/.github/README_tr.md @@ -521,7 +521,7 @@ This is a list of middlewares that are created by the Fiber community, please cr - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_zh-CN.md b/.github/README_zh-CN.md index 00d117b8..6e64bd55 100644 --- a/.github/README_zh-CN.md +++ b/.github/README_zh-CN.md @@ -104,10 +104,9 @@ func main() {

## ⚙️ 安装 +确保已安装 ([下载](https://golang.org/dl/)) `1.14` 或更高版本的 Go。 -Make sure you have Go installed ([download](https://golang.org/dl/)). Version `1.14` or higher is required. - -Initialize your project by creating a folder and then running `go mod init github.com/your/repo` ([learn more](https://blog.golang.org/using-go-modules)) inside the folder. Then install Fiber with the [`go get`](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) command: +通过创建文件夹并在文件夹内运行 `go mod init github.com/your/repo` ([了解更多](https://blog.golang.org/using-go-modules)) 来初始化项目,然后使用 [`go get`](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) 命令安装 Fiber: ```bash go get -u github.com/gofiber/fiber/v2 @@ -524,7 +523,7 @@ List of externally hosted middleware modules and maintained by the [Fiber team]( - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/.github/README_zh-TW.md b/.github/README_zh-TW.md index d3d6087d..5d8c86ae 100644 --- a/.github/README_zh-TW.md +++ b/.github/README_zh-TW.md @@ -524,7 +524,7 @@ List of externally hosted middleware modules and maintained by the [Fiber team]( - [arsmn/fiber-swagger](https://github.com/arsmn/fiber-swagger) - [arsmn/gqlgen](https://github.com/arsmn/gqlgen) - [codemicro/fiber-cache](https://github.com/codemicro/fiber-cache) -- [itsursujit/fiber-boilerplate](https://github.com/itsursujit/fiber-boilerplate) +- [sujit-baniya/fiber-boilerplate](https://github.com/sujit-baniya/fiber-boilerplate) - [juandiii/go-jwk-security](https://github.com/juandiii/go-jwk-security) - [kiyonlin/fiber_limiter](https://github.com/kiyonlin/fiber_limiter) - [shareed2k/fiber_limiter](https://github.com/shareed2k/fiber_limiter) diff --git a/app_test.go b/app_test.go index 703897ed..af8c421c 100644 --- a/app_test.go +++ b/app_test.go @@ -562,7 +562,7 @@ func Test_App_Static_Direct(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get("Content-Type")) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get("Content-Type")) utils.AssertEqual(t, "", resp.Header.Get(HeaderCacheControl), "CacheControl Control") body, err = ioutil.ReadAll(resp.Body) @@ -600,7 +600,7 @@ func Test_App_Static_Group(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) utils.AssertEqual(t, "123", resp.Header.Get("Test-Header")) grp = app.Group("/v2") @@ -611,7 +611,7 @@ func Test_App_Static_Group(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) } @@ -625,7 +625,7 @@ func Test_App_Static_Wildcard(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) body, err := ioutil.ReadAll(resp.Body) utils.AssertEqual(t, nil, err) @@ -643,7 +643,7 @@ func Test_App_Static_Prefix_Wildcard(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) app.Static("/my/nameisjohn*", "./.github/FUNDING.yml") @@ -651,7 +651,7 @@ func Test_App_Static_Prefix_Wildcard(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) body, err := ioutil.ReadAll(resp.Body) utils.AssertEqual(t, nil, err) @@ -667,7 +667,7 @@ func Test_App_Static_Prefix(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) app.Static("/prefix", "./.github/workflows") @@ -676,7 +676,7 @@ func Test_App_Static_Prefix(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) app.Static("/single", "./.github/workflows/test.yml") @@ -685,7 +685,7 @@ func Test_App_Static_Prefix(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 200, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) } func Test_App_Static_Trailing_Slash(t *testing.T) { @@ -697,7 +697,7 @@ func Test_App_Static_Trailing_Slash(t *testing.T) { utils.AssertEqual(t, nil, err, "app.Test(req)") utils.AssertEqual(t, 404, resp.StatusCode, "Status code") utils.AssertEqual(t, false, resp.Header.Get(HeaderContentLength) == "") - utils.AssertEqual(t, "text/plain; charset=utf-8", resp.Header.Get(HeaderContentType)) + utils.AssertEqual(t, MIMETextPlainCharsetUTF8, resp.Header.Get(HeaderContentType)) } // go test -run Test_App_Mixed_Routes_WithSameLen diff --git a/middleware/logger/README.md b/middleware/logger/README.md index 6b8fc785..cfea522b 100644 --- a/middleware/logger/README.md +++ b/middleware/logger/README.md @@ -13,8 +13,8 @@ Logger middleware for [Fiber](https://github.com/gofiber/fiber) that logs HTTP r func New(config ...Config) fiber.Handler ``` -### Examples -Import the middleware package that is part of the Fiber web framework +## Examples +First ensure the appropriate packages are imported ```go import ( "github.com/gofiber/fiber/v2" @@ -22,17 +22,42 @@ import ( ) ``` -After you initiate your Fiber app, you can use the following possibilities: +#### **Initialization / Default Config** ```go // Default middleware config app.Use(logger.New()) +``` -// Or extend your config for customization +#### **Logging Request ID** +```go +app.Use(requestid.New()) + +​app​.​Use​(​logger​.​New​(logger.​Config​{ + // For more options, see the Config section + Format​: "${pid} ${locals:requestid} ${status} - ${method} ${path}​\n​"​, +})) +``` + +#### **Changing TimeZone & TimeFormat** + +```go app.Use(logger.New(logger.Config{ Format: "${pid} ${status} - ${method} ${path}\n", TimeFormat: "02-Jan-2006", TimeZone: "America/New_York", - Output: os.Stdout, +})) +``` + +#### **Custom File Writer** +```go +file, err := os.OpenFile("./123.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) +if err != nil { + log.Fatalf("error opening file: %v", err) +} +defer file.Close() + +app.Use(logger.New(logger.Config{ + Output: file, })) ```