mirror of
https://github.com/openziti/zrok.git
synced 2025-06-19 17:27:54 +02: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) {
|
func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {
|
||||||
|
if cmd.subordinate {
|
||||||
|
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||||
|
}
|
||||||
|
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.error(err)
|
cmd.error(err)
|
||||||
|
@ -26,6 +26,7 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -70,6 +71,10 @@ func newSharePrivateCommand() *sharePrivateCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
|
func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
|
||||||
|
if cmd.subordinate {
|
||||||
|
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||||
|
}
|
||||||
|
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.error("error loading environment", err)
|
cmd.error("error loading environment", err)
|
||||||
|
@ -85,6 +85,10 @@ func newSharePublicCommand() *sharePublicCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
|
func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
|
||||||
|
if cmd.subordinate {
|
||||||
|
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||||
|
}
|
||||||
|
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.error("error loading environment", err)
|
cmd.error("error loading environment", err)
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -65,6 +66,10 @@ func newShareReservedCommand() *shareReservedCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
|
func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
|
||||||
|
if cmd.subordinate {
|
||||||
|
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano})
|
||||||
|
}
|
||||||
|
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.error("error loading environment", err)
|
cmd.error("error loading environment", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user