1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-12 06:00:25 +08:00

AUTH-2729 added log file and level to cmd flags to match config file settings

This commit is contained in:
Dalton
2020-06-05 10:18:40 -05:00
committed by Dalton Cherry
parent 2f70b05c64
commit f8638839c0
3 changed files with 37 additions and 11 deletions

View File

@@ -44,6 +44,17 @@ func StartForwarder(forwarder config.Forwarder, shutdown <-chan struct{}, logger
// (which you can put Access in front of)
func ssh(c *cli.Context) error {
logDirectory, logLevel := config.FindLogSettings()
flagLogDirectory := c.String(sshLogDirectoryFlag)
if flagLogDirectory != "" {
logDirectory = flagLogDirectory
}
flagLogLevel := c.String(sshLogLevelFlag)
if flagLogLevel != "" {
logLevel = flagLogLevel
}
logger, err := logger.New(logger.DefaultFile(logDirectory), logger.LogLevelString(logLevel))
if err != nil {
return errors.Wrap(err, "error setting up logger")