Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4d71261
Remove `glog` logging support
mhamza15 Sep 30, 2026
78710cf
Note the logging flags that had no v24 deprecation warning
mhamza15 Sep 30, 2026
b25231a
Emit Azure SDK logs only at debug level
mhamza15 Sep 30, 2026
5da21fd
Remove logutil.Flush and the /debug/flushlogs endpoint
mhamza15 Sep 30, 2026
fb90ce6
Remove the stale logutil flag comment in servenv
mhamza15 Sep 30, 2026
bf9fbd7
Remove the stale TrickGlog comment in vtctldclient
mhamza15 Sep 30, 2026
7072cf7
Restore the mysqlctl start, shutdown, and teardown examples
mhamza15 Sep 30, 2026
0dede3b
Remove TestRegisterFlags
mhamza15 Sep 30, 2026
5f6147c
Restore the log and init doc comments in go/vt/log
mhamza15 Sep 30, 2026
145e22f
Report no gRPC verbosity level as enabled
mhamza15 Sep 30, 2026
33611a6
Drop the unused FlagSet parameter from log.Init
mhamza15 Sep 30, 2026
30a6e01
Explain why syslog connects when servenv initializes
mhamza15 Sep 30, 2026
406a870
Remove trickGlog from rowlog
mhamza15 Sep 30, 2026
b5bb28a
Remove the unused logging group from find_flag_definitions.py
mhamza15 Sep 30, 2026
445f67a
Remove trailing newlines from two debug log messages
mhamza15 Sep 30, 2026
028c751
Rewrite the glog removal release notes
mhamza15 Sep 30, 2026
768da08
Default the log level and format when the flags are not registered
mhamza15 Sep 30, 2026
b26b716
Build the Vitess tester from vitessio/vt#100
mhamza15 Sep 30, 2026
5ecb9b3
Remove references to glog log files
mhamza15 Sep 30, 2026
99f06b3
Build the Vitess tester from the latest vitessio/vt#100 commit
mhamza15 Sep 30, 2026
b1cc2c3
Build the Vitess tester from the latest vitessio/vt#100 commit
mhamza15 Sep 30, 2026
4e9fe40
Merge remote-tracking branch 'origin/main' into pr/21309-remove-glog
mhamza15 Sep 30, 2026
e13ac21
Install the Vitess tester from vitessio/vt main
mhamza15 Sep 30, 2026
4223046
Keep the logging flags that v24 did not deprecate as no-ops
mhamza15 Oct 1, 2026
a8e31bb
Keep `/debug/flushlogs` as a no-op
mhamza15 Oct 1, 2026
e29da24
Remove the read of `vtcombo.INFO` from the vttestserver test
mhamza15 Oct 1, 2026
8e498c3
Remove the Go API migration list from the glog release notes
mhamza15 Oct 1, 2026
b8ecc20
Remove the standard library flag code that only served glog
mhamza15 Oct 1, 2026
4609be0
Merge the e2e-tests skill steps that read the stderr files
mhamza15 Oct 1, 2026
59d3fd2
Explain why `ParseFlagsForTest` adds the Go flag set
mhamza15 Oct 1, 2026
522a8a6
Merge remote-tracking branch 'origin/main' into pr/21309-remove-glog
mhamza15 Oct 1, 2026
40abcee
Use `errors.New` for the `--log-structured=false` error
mhamza15 Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions changelog/25.0/25.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- **[New Support](#new-support)**
- [VTOrc failover of an unreachable primary `vttablet` via replica quorum](#vtorc-quorum-unreachable-primary)
- **[Breaking Changes](#breaking-changes)**
- [`glog` logging removed](#glog-removed)
- [`--watch-replication-stream` flag removed](#vttablet-watch-replication-stream-removed)
- [VRLog feature removed](#vttablet-vrlog-removed)
- [Snapshot Topology feature removed](#vtorc-snapshot-topology-removed)
Expand Down Expand Up @@ -113,6 +114,29 @@ See [#19918](https://github.com/vitessio/vitess/issues/19918).

### <a id="breaking-changes"/>Breaking Changes</a>

#### <a id="glog-removed"/>`glog` logging removed</a>

Vitess now uses structured logging exclusively. The deprecated `glog` backend, its command-line flags,
`log.Flush`, and `log.V` have been removed.

The following flags have been removed from all binaries.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several of these flags never had a deprecation warning, so v25 would reject them without any prior notice:

  • --log-structured. main's deprecation message for the glog flags actually tells users to pass it: use the default structured logging instead ("--log-structured").
  • --log-rotate-max-size
  • --keep-logs, --keep-logs-by-mtime, --purge-logs-interval
  • --log_link, --logbuflevel
  • all glog flags on vtctldclient, vtctlclient, vtbench and vtclient. They come in through AddGoFlagSet without MarkDeprecated, so they are listed in the v24 help output. The v24 operator README also recommended alias vtctldclient="vtctldclient ... --alsologtostderr".

Two external tools also still pass removed flags, and that is what the other two red jobs are:

  • VTop Example: vitess-operator passes --logtostderr to vttablet, mysqlctld, vtgate, vtctld and vtorc, and --logtostderr --alsologtostderr to vtadmin (e.g. pkg/operator/vttablet/flags.go, pkg/operator/vtadmin/deployment.go). Every Vitess pod ends up in CrashLoopBackOff. So the operator impact is wider than operator.yaml: every operator-managed v25 component fails to start until the operator stops passing these flags.
  • Vitess Tester: the pinned github.com/vitessio/vt passes --log_dir to vtctld, which exits with unknown flag: --log_dir.

Could we keep the removed logging flags in v25 as hidden no-ops that print "has no effect and will be removed in v26", reject --log-structured=false with a clear error since glog is gone, and drop them in v26? The alternative is releasing operator and vt updates first and bumping the pins here.

@mhamza15 mhamza15 Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to update the operator and vt, LMK if you feel strongly about adding the no-ops. The release notes call out the flags that never had a warning (78710cf). For the red jobs I opened planetscale/vitess-operator#846, which drops the flags on main so :latest picks it up, and vitessio/vt#100, which moves vt to Vitess main. The tester workflow builds from the vt#100 head until it merges (b26b716).


- `--log-structured`
- `--log-rotate-max-size`
- `--logtostderr`, `--alsologtostderr`, `--stderrthreshold`
- `--log_dir`, `--log_link`, `--log_backtrace_at`
- `--v`, `--vmodule`, `--logbuflevel`
- `--keep-logs`, `--keep-logs-by-mtime`, `--purge-logs-interval`

In `vtctldclient`, `-v` is now the shorthand for `--version`, matching the other binaries.

**Migration**: remove the flags above from startup arguments. Use `--log-level=debug` for debug logs and
`--log-format=text` for human-readable output. Logs are written to stderr, so redirect or collect stderr to keep them
in files.

**Impact**: binaries will fail to start when passed a removed logging flag. Go callers must replace `log.V` with
`log.Debug` and remove calls to `log.Flush`.

#### <a id="vttablet-watch-replication-stream-removed"/>`--watch-replication-stream` flag removed</a>

The deprecated `--watch-replication-stream` VTTablet flag has been removed.
Expand Down
1 change: 0 additions & 1 deletion docker/mini/vtctld-mini-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ vtctld \
-service-map 'grpc-vtctl' \
-backup-storage-implementation file \
-file-backup-storage-root $VTDATAROOT/backups \
-log_dir $VTDATAROOT/tmp \
-port $vtctld_web_port \
-grpc-port $grpc_port \
-pid-file $VTDATAROOT/tmp/vtctld.pid \
Expand Down
1 change: 0 additions & 1 deletion docker/mini/vttablet-mini-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ echo " - Tablet listens on http://$hostname:$port"
# shellcheck disable=SC2086
vttablet \
$TOPOLOGY_FLAGS \
-log_dir $VTDATAROOT/tmp \
-log-queries-to-file $VTDATAROOT/tmp/$tablet_logfile \
-tablet-path $alias \
-tablet-hostname "$hostname" \
Expand Down
1 change: 0 additions & 1 deletion examples/common/backup-scripts/mysqlctl-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ if [ -d $VTDATAROOT/$tablet_dir ]; then
fi

mysqlctl \
--log_dir $VTDATAROOT/tmp \
--tablet-uid $uid \
--mysql-port $mysql_port \
$action
Expand Down
2 changes: 0 additions & 2 deletions examples/common/backup-scripts/vtadmin-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ vtadmin \
--tracer "opentelemetry" \
--grpc-tracing \
--http-tracing \
--logtostderr \
--alsologtostderr \
--rbac \
--rbac-config="${script_dir}/../vtadmin/rbac.yaml" \
--cluster "id=${cluster_name},name=${cluster_name},discovery=staticfile,discovery-staticfile-path=${script_dir}/../vtadmin/discovery.json,tablet-fqdn-tmpl=http://{{ .Tablet.Hostname }}:15{{ .Tablet.Alias.Uid }},schema-cache-default-expiration=1m" \
Expand Down
1 change: 0 additions & 1 deletion examples/common/backup-scripts/vtctld-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ vtctld \
--service-map 'grpc-vtctl,grpc-vtctld' \
--backup-storage-implementation file \
--file-backup-storage-root $VTDATAROOT/backups \
--log_dir $VTDATAROOT/tmp \
--port $vtctld_web_port \
--grpc-port $grpc_port \
--pid-file $VTDATAROOT/tmp/vtctld.pid \
Expand Down
1 change: 0 additions & 1 deletion examples/common/backup-scripts/vtgate-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ echo "Starting vtgate..."
# shellcheck disable=SC2086
vtgate \
$TOPOLOGY_FLAGS \
--log_dir $VTDATAROOT/tmp \
--log-queries-to-file $VTDATAROOT/tmp/vtgate_querylog.txt \
--port $web_port \
--grpc-port $grpc_port \
Expand Down
2 changes: 0 additions & 2 deletions examples/common/backup-scripts/vtorc-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ port=16000
echo "Starting vtorc..."
vtorc \
$TOPOLOGY_FLAGS \
--logtostderr \
--alsologtostderr \
--config-path="${script_dir}/../vtorc/" \
--config-name="config.yaml" \
--config-type="yml" \
Expand Down
1 change: 0 additions & 1 deletion examples/common/backup-scripts/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ echo "Topology flags at start of backup vttablet, after explicitly setting: $TOP
# shellcheck disable=SC2086
vttablet \
$TOPOLOGY_FLAGS \
--log_dir $VTDATAROOT/tmp \
--log-queries-to-file $VTDATAROOT/tmp/$tablet_logfile \
--tablet-path $alias \
--tablet-hostname "$tablet_hostname" \
Expand Down
3 changes: 1 addition & 2 deletions examples/common/backup-scripts/zk-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ source "$(dirname "${BASH_SOURCE[0]:-$0}")/../env.sh"
# Stop ZooKeeper servers.
echo "Stopping zk servers..."
for zkid in $zkids; do
zkctl --zk.myid $zkid --zk.cfg $zkcfg --log_dir $VTDATAROOT/tmp shutdown
zkctl --zk.myid $zkid --zk.cfg $zkcfg shutdown
done

2 changes: 1 addition & 1 deletion examples/common/backup-scripts/zk-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for zkid in $zkids; do
echo " $VTDATAROOT/$zkdir"
action='start'
fi
zkctl --zk.myid $zkid --zk.cfg $zkcfg --log_dir $VTDATAROOT/tmp $action \
zkctl --zk.myid $zkid --zk.cfg $zkcfg $action \
> $VTDATAROOT/tmp/zkctl_$zkid.out 2>&1 &
pids[$zkid]=$!
done
Expand Down
2 changes: 0 additions & 2 deletions examples/common/scripts/vtadmin-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ vtadmin \
--tracer "opentelemetry" \
--grpc-tracing \
--http-tracing \
--logtostderr \
--alsologtostderr \
--rbac \
--rbac-config="${script_dir}/../vtadmin/rbac.yaml" \
--cluster "id=${cluster_name},name=${cluster_name},discovery=staticfile,discovery-staticfile-path=${script_dir}/../vtadmin/discovery.json,tablet-fqdn-tmpl=http://{{ .Tablet.Hostname }}:15{{ .Tablet.Alias.Uid }},schema-cache-default-expiration=1m" \
Expand Down
2 changes: 0 additions & 2 deletions examples/common/scripts/vtorc-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ port=16000
echo "Starting vtorc..."
vtorc \
$TOPOLOGY_FLAGS \
--logtostderr \
--alsologtostderr \
--config-path="${script_dir}/../vtorc/" \
--config-name="config.yaml" \
--config-type="yml" \
Expand Down
2 changes: 1 addition & 1 deletion examples/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kubectl apply -f 101_initial_cluster.yaml
# VTAdmin's UI will be available at http://localhost:14000/
./pf.sh &
alias mysql="mysql -h 127.0.0.1 -P 15306 -u user"
alias vtctldclient="vtctldclient --server localhost:15999 --alsologtostderr"
alias vtctldclient="vtctldclient --server localhost:15999"
vtctldclient ApplySchema --sql="$(cat ../common/create_commerce_schema.sql)" commerce
vtctldclient ApplyVSchema --vschema="$(cat ../common/vschema_commerce_initial.json)" commerce

Expand Down
2 changes: 1 addition & 1 deletion examples/operator/pf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kubectl port-forward -n example --address localhost "$(kubectl get service -n ex
process_id3=$!
sleep 2
echo "You may point your browser to http://localhost:15000, use the following aliases as shortcuts:"
echo 'alias vtctldclient="vtctldclient --server=localhost:15999 --logtostderr"'
echo 'alias vtctldclient="vtctldclient --server=localhost:15999"'
echo 'alias mysql="mysql -h 127.0.0.1 -P 15306 -u user"'
echo "Hit Ctrl-C to stop the port forwards"
wait $process_id1
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ require (
github.com/gammazero/deque v1.2.1
github.com/go-sql-driver/mysql v1.10.1
github.com/go-viper/mapstructure/v2 v2.5.0
github.com/golang/glog v1.2.5
github.com/golang/snappy v1.0.0
github.com/google/go-cmp v0.7.0
github.com/google/go-containerregistry v0.22.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I=
github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
1 change: 0 additions & 1 deletion go/cmd/mysqlctl/command/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var Init = &cobra.Command{
Long: "Bootstraps a new `mysqld` instance, initializes its data directory, and starts the instance.\n" +
"The MySQL version and flavor will be auto-detected, with a minimal configuration file applied.",
Example: `mysqlctl \
--alsologtostderr \
--tablet-uid 101 \
--mysql-port 12345 \
init`,
Expand Down
1 change: 0 additions & 1 deletion go/cmd/mysqlctl/command/init_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var InitConfig = &cobra.Command{
Long: "Bootstraps the configuration for a new `mysqld` instance and initializes its data directory.\n" +
"This command is the same as `init` except the `mysqld` server will not be started.",
Example: `mysqlctl \
--alsologtostderr \
--tablet-uid 101 \
--mysql-port 12345 \
init_config`,
Expand Down
1 change: 0 additions & 1 deletion go/cmd/mysqlctl/command/reinit_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ var ReinitConfig = &cobra.Command{
Long: "Regenerate new configuration files for an existing `mysqld` instance (generating new server_id and server_uuid values).\n" +
"This could be helpful to revert configuration changes, or to pick up changes made to the bundled config in newer Vitess versions.",
Example: `mysqlctl \
--alsologtostderr \
--tablet-uid 101 \
--mysql-port 12345 \
reinit_config`,
Expand Down
5 changes: 2 additions & 3 deletions go/cmd/mysqlctl/command/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ var Shutdown = &cobra.Command{
Short: "Shuts down mysqld, without removing any files.",
Long: "Stop a `mysqld` instance that was previously started with `init` or `start`.\n\n" +
"For large `mysqld` instances, you may need to extend the `wait-time` to shutdown cleanly.",
Example: `mysqlctl --tablet-uid 101 --alsologtostderr shutdown`,
Args: cobra.NoArgs,
RunE: commandShutdown,
Args: cobra.NoArgs,
RunE: commandShutdown,
}

var shutdownArgs = struct {
Expand Down
11 changes: 5 additions & 6 deletions go/cmd/mysqlctl/command/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ import (
)

var Start = &cobra.Command{
Use: "start",
Short: "Starts mysqld on an already 'init'-ed directory.",
Long: "Resume an existing `mysqld` instance that was previously bootstrapped with `init` or `init_config`",
Example: `mysqlctl --tablet-uid 101 --alsologtostderr start`,
Args: cobra.NoArgs,
RunE: commandStart,
Use: "start",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this removes the whole Example rather than just --alsologtostderr, so the generated docs for start, shutdown and teardown lose their examples. mysqlctl --tablet-uid 101 start would keep it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored for start, shutdown, and teardown without the flag (7072cf7).

Short: "Starts mysqld on an already 'init'-ed directory.",
Long: "Resume an existing `mysqld` instance that was previously bootstrapped with `init` or `init_config`",
Args: cobra.NoArgs,
RunE: commandStart,
}

var startArgs = struct {
Expand Down
5 changes: 2 additions & 3 deletions go/cmd/mysqlctl/command/teardown.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ var Teardown = &cobra.Command{
"This is a destructive operation.\n" +
"{{</ warning >}}\n\n" +
"Shuts down a `mysqld` instance and removes its data directory.",
Example: `mysqlctl --tablet-uid 101 --alsologtostderr teardown`,
Args: cobra.NoArgs,
RunE: commandTeardown,
Args: cobra.NoArgs,
RunE: commandTeardown,
}

var teardownArgs = struct {
Expand Down
1 change: 0 additions & 1 deletion go/cmd/mysqlctld/cli/mysqlctld.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ var (
"{{</ warning>}}\n\n" +
"To enable communication with a `vttablet`, the server must be configured to receive gRPC messages on a unix domain socket.",
Example: `mysqlctld \
--log_dir=${VTDATAROOT}/logs \
--tablet-uid=100 \
--mysql-port=17100 \
--socket-file=/path/to/socket-file`,
Expand Down
6 changes: 0 additions & 6 deletions go/cmd/rulesctl/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ package cmd
import (
"github.com/spf13/cobra"

_flag "vitess.io/vitess/go/internal/flag"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
)

var configFile string
Expand All @@ -31,14 +29,10 @@ func Main() *cobra.Command {
Use: "rulesctl",
Args: cobra.NoArgs,
PreRunE: func(cmd *cobra.Command, args []string) error {
_flag.TrickGlog()

if err := log.Init(cmd.Flags()); err != nil {
return err
}

logutil.PurgeLogs()

return nil
},
Run: func(cmd *cobra.Command, _ []string) { cmd.Help() },
Expand Down
2 changes: 0 additions & 2 deletions go/cmd/rulesctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"vitess.io/vitess/go/acl"
"vitess.io/vitess/go/cmd/rulesctl/cmd"
vtlog "vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/utils"
)
Expand All @@ -31,7 +30,6 @@ func main() {
rootCmd := cmd.Main()
rootCmd.SetGlobalNormalizationFunc(utils.NormalizeUnderscoresToDashes)
vtlog.RegisterFlags(rootCmd.PersistentFlags())
logutil.RegisterFlags(rootCmd.PersistentFlags())
acl.RegisterFlags(rootCmd.PersistentFlags())
servenv.RegisterMySQLServerFlags(rootCmd.PersistentFlags())
if err := rootCmd.Execute(); err != nil {
Expand Down
22 changes: 0 additions & 22 deletions go/cmd/vtadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ limitations under the License.
package main

import (
"flag"
"fmt"
"io"
"os"
"time"

"github.com/spf13/cobra"

_flag "vitess.io/vitess/go/internal/flag"
"vitess.io/vitess/go/trace"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/utils"
"vitess.io/vitess/go/vt/vtadmin"
Expand Down Expand Up @@ -61,14 +58,10 @@ var (
rootCmd = &cobra.Command{
Use: "vtadmin",
PreRunE: func(cmd *cobra.Command, args []string) error {
_flag.TrickGlog()

if err := log.Init(cmd.Flags()); err != nil {
return err
}

logutil.PurgeLogs()

if opts.EnableTracing || httpOpts.EnableTracing {
startTracing(cmd)
}
Expand Down Expand Up @@ -220,23 +213,8 @@ func registerFlags() {
"Note: any whitespace characters are replaced with hyphens."
rootCmd.Flags().StringVar(&cacheRefreshKey, "cache-refresh-key", "vt-cache-refresh", cacheRefreshHelp)

// Structured logging flags.
log.RegisterFlags(rootCmd.Flags())

// glog flags, no better way to do this
rootCmd.Flags().AddGoFlag(flag.Lookup("v"))
rootCmd.Flags().AddGoFlag(flag.Lookup("logtostderr"))
rootCmd.Flags().AddGoFlag(flag.Lookup("alsologtostderr"))
rootCmd.Flags().AddGoFlag(flag.Lookup("stderrthreshold"))
rootCmd.Flags().AddGoFlag(flag.Lookup("log_dir"))

const deprecationMsg = "glog and its flags have been deprecated, use the default structured logging instead (\"--log-structured\")"
rootCmd.Flags().MarkDeprecated("v", deprecationMsg)
rootCmd.Flags().MarkDeprecated("logtostderr", deprecationMsg)
rootCmd.Flags().MarkDeprecated("alsologtostderr", deprecationMsg)
rootCmd.Flags().MarkDeprecated("stderrthreshold", deprecationMsg)
rootCmd.Flags().MarkDeprecated("log_dir", deprecationMsg)

servenv.RegisterMySQLServerFlags(rootCmd.Flags())

// Register TLS flags for gRPC connections to vtctld
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtbench/cli/vtbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func run(cmd *cobra.Command, args []string) error {
writer := logutil.NewLoggerWriter(logger)
cmd.SetOut(writer)
cmd.SetErr(writer)
_ = cmd.Flags().Set("logtostderr", "true")

servenv.Init()

Expand Down
2 changes: 0 additions & 2 deletions go/cmd/vtclient/cli/vtclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ func run(cmd *cobra.Command, args []string) error {
}

func _run(cmd *cobra.Command, args []string) (*results, error) {
logutil.PurgeLogs()

if maxSeqID > minSeqID {
go func() {
if useRandom {
Expand Down
4 changes: 0 additions & 4 deletions go/cmd/vtcombo/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ func run(cmd *cobra.Command, args []string) (err error) {

cmd.Flags().Set("cells-to-watch", strings.Join(tpb.Cells, ","))

if f := cmd.Flags().Lookup("log_dir"); f != nil && !f.Changed {
cmd.Flags().Set("log_dir", "$VTDATAROOT/tmp")
}

env, err = vtenv.New(vtenv.Options{
MySQLServerVersion: servenv.MySQLServerVersion(),
TruncateUILen: servenv.TruncateUILen,
Expand Down
2 changes: 0 additions & 2 deletions go/cmd/vtctldclient/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

"vitess.io/vitess/go/trace"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/topo"
"vitess.io/vitess/go/vt/utils"
Expand Down Expand Up @@ -119,7 +118,6 @@ connect directly to the topo server(s).`, useInternalVtctld),
return fmt.Errorf("failed to initialize vtenv: %w", err)
}

logutil.PurgeLogs()
traceCloser = trace.StartTracing("vtctldclient")
client, err = getClientForCommand(cmd)
ctx := cmd.Context()
Expand Down
Loading
Loading