mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add FN_LOG_DEST for logs, fixup init (#663)
* add FN_LOG_DEST for logs, fixup init * FN_LOG_DEST can point to a remote logging place (papertrail, whatever) * FN_LOG_PREFIX can add a prefix onto each log line sent to FN_LOG_DEST default remains stderr with no prefix. users need this to send to various logging backends, though it could be done operationally, this is somewhat simpler. we were doing some configuration stuff inside of init() for some of the global things. even though they're global, it's nice to keep them all in the normal server init path. we have had strange issues with the tracing setup, I tested the last repro of this repeatedly and didn't have any luck reproducing it, though maybe it comes back. * add docs
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -18,6 +19,12 @@ func SetLogLevel(ll string) {
|
||||
logLevel = logrus.InfoLevel
|
||||
}
|
||||
logrus.SetLevel(logLevel)
|
||||
|
||||
// this effectively just adds more gin log goodies
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
if logLevel == logrus.DebugLevel {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
}
|
||||
}
|
||||
|
||||
func SetLogDest(to, prefix string) {
|
||||
|
||||
Reference in New Issue
Block a user