Golang's echo framework log is located in the file. Default is stdio

golang"s echo framework log is located in the file. By default, stdio, is found to be unavailable after modification

I don"t know what the problem is, file design 0777


fd, _ := os.OpenFile(
        LogPath,
        os.O_RDWR|os.O_APPEND,
        0666,
    )

e.Use(middleware.LoggerWithConfig(
        middleware.LoggerConfig{
            Format: "method=${method}, uri=${uri}, status=${status}\n",
            Output: fd,
        }))

    e.Logger.SetOutput(fd)
The

problem has been resolved, not a code problem. It"s a log file deadlock.

Mar.22,2021

it is recommended that you specify the write file with log, and use

in middleware.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b716-2c289.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b716-2c289.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?