mirror of
https://github.com/openziti/zrok.git
synced 2025-01-08 23:20:04 +01:00
use json logging when in subordinate mode (#789)
This commit is contained in:
parent
85a22950a7
commit
6b4dbaafb0
@ -77,6 +77,10 @@ func newAccessPrivateCommand() *accessPrivateCommand {
|
||||
}
|
||||
|
||||
func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {
|
||||
if cmd.subordinate {
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||
}
|
||||
|
||||
root, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
cmd.error(err)
|
||||
|
@ -26,6 +26,7 @@ import (
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -70,6 +71,10 @@ func newSharePrivateCommand() *sharePrivateCommand {
|
||||
}
|
||||
|
||||
func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
|
||||
if cmd.subordinate {
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||
}
|
||||
|
||||
root, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
cmd.error("error loading environment", err)
|
||||
|
@ -85,6 +85,10 @@ func newSharePublicCommand() *sharePublicCommand {
|
||||
}
|
||||
|
||||
func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
|
||||
if cmd.subordinate {
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||
}
|
||||
|
||||
root, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
cmd.error("error loading environment", err)
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -65,6 +66,10 @@ func newShareReservedCommand() *shareReservedCommand {
|
||||
}
|
||||
|
||||
func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
|
||||
if cmd.subordinate {
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||
}
|
||||
|
||||
root, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
cmd.error("error loading environment", err)
|
||||
|
Loading…
Reference in New Issue
Block a user