diff --git a/src/commands.def b/src/commands.def index f425d44462..9040de1dd0 100644 --- a/src/commands.def +++ b/src/commands.def @@ -6823,7 +6823,7 @@ const char *FATLOG_RESET_Tips[] = { /* FATLOG command table */ struct COMMAND_STRUCT FATLOG_Subcommands[] = { {MAKE_CMD("get","Returns the fat log's entries.","O(N) where N is the number of entries returned","8.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,FATLOG_GET_History,0,FATLOG_GET_Tips,2,slowlogCommand,-2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,FATLOG_GET_Keyspecs,0,NULL,1),.args=FATLOG_GET_Args}, -{MAKE_CMD("help","Show helpful text about the different subcommands","O(1)","8.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,FATLOG_HELP_History,0,FATLOG_HELP_Tips,0,slowlogCommand,2,CMD_LOADING|CMD_STALE,0,FATLOG_HELP_Keyspecs,0,NULL,0)}, +{MAKE_CMD("help","Returns helpful text about the different subcommands","O(1)","8.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,FATLOG_HELP_History,0,FATLOG_HELP_Tips,0,slowlogCommand,2,CMD_LOADING|CMD_STALE,0,FATLOG_HELP_Keyspecs,0,NULL,0)}, {MAKE_CMD("len","Returns the number of entries in the fat log.","O(1)","8.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,FATLOG_LEN_History,0,FATLOG_LEN_Tips,3,slowlogCommand,2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,FATLOG_LEN_Keyspecs,0,NULL,0)}, {MAKE_CMD("reset","Clears all entries from the fat log.","O(N) where N is the number of entries in the fatlog","8.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,FATLOG_RESET_History,0,FATLOG_RESET_Tips,2,slowlogCommand,2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,FATLOG_RESET_Keyspecs,0,NULL,0)}, {0} @@ -7801,7 +7801,7 @@ const char *SLOWLOG_RESET_Tips[] = { /* SLOWLOG command table */ struct COMMAND_STRUCT SLOWLOG_Subcommands[] = { {MAKE_CMD("get","Returns the slow log's entries.","O(N) where N is the number of entries returned","2.2.12",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_GET_History,1,SLOWLOG_GET_Tips,2,slowlogCommand,-2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,SLOWLOG_GET_Keyspecs,0,NULL,1),.args=SLOWLOG_GET_Args}, -{MAKE_CMD("help","Show helpful text about the different subcommands","O(1)","6.2.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_HELP_History,0,SLOWLOG_HELP_Tips,0,slowlogCommand,2,CMD_LOADING|CMD_STALE,0,SLOWLOG_HELP_Keyspecs,0,NULL,0)}, +{MAKE_CMD("help","Returns helpful text about the different subcommands","O(1)","6.2.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_HELP_History,0,SLOWLOG_HELP_Tips,0,slowlogCommand,2,CMD_LOADING|CMD_STALE,0,SLOWLOG_HELP_Keyspecs,0,NULL,0)}, {MAKE_CMD("len","Returns the number of entries in the slow log.","O(1)","2.2.12",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_LEN_History,0,SLOWLOG_LEN_Tips,3,slowlogCommand,2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,SLOWLOG_LEN_Keyspecs,0,NULL,0)}, {MAKE_CMD("reset","Clears all entries from the slow log.","O(N) where N is the number of entries in the slowlog","2.2.12",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_RESET_History,0,SLOWLOG_RESET_Tips,2,slowlogCommand,2,CMD_ADMIN|CMD_LOADING|CMD_STALE,0,SLOWLOG_RESET_Keyspecs,0,NULL,0)}, {0} diff --git a/src/commands/fatlog-help.json b/src/commands/fatlog-help.json index b3dc00dfb0..1205978320 100644 --- a/src/commands/fatlog-help.json +++ b/src/commands/fatlog-help.json @@ -1,6 +1,6 @@ { "HELP": { - "summary": "Show helpful text about the different subcommands", + "summary": "Returns helpful text about the different subcommands", "complexity": "O(1)", "group": "server", "since": "8.0.0", diff --git a/src/commands/slowlog-help.json b/src/commands/slowlog-help.json index dde8fd4598..b8628a3154 100644 --- a/src/commands/slowlog-help.json +++ b/src/commands/slowlog-help.json @@ -1,6 +1,6 @@ { "HELP": { - "summary": "Show helpful text about the different subcommands", + "summary": "Returns helpful text about the different subcommands", "complexity": "O(1)", "group": "server", "since": "6.2.0", diff --git a/src/server.c b/src/server.c index d266b14b8a..a3a85ca8b9 100644 --- a/src/server.c +++ b/src/server.c @@ -3239,7 +3239,7 @@ void preventCommandReplication(client *c) { /* Log the last command a client executed into the slowlog. */ void slowlogPushCurrentCommand(client *c, struct serverCommand *cmd, ustime_t duration) { - /* Some commands may contain sensitive data that should not be available in the slowlog. */ + /* Some commands should not be available in the slowlog and the fatlog. */ if (cmd->flags & CMD_SKIP_SLOWLOG) return; /* If command argument vector was rewritten, use the original @@ -3251,7 +3251,7 @@ void slowlogPushCurrentCommand(client *c, struct serverCommand *cmd, ustime_t du /* Log the last command a client executed into the fatlog. */ void fatlogPushCurrentCommand(client *c, struct serverCommand *cmd, size_t size) { - /* Some commands may contain sensitive data that should not be available in the fatlog. */ + /* Some commands should not be available in the slowlog and the fatlog. */ if (cmd->flags & CMD_SKIP_SLOWLOG) return; /* If command argument vector was rewritten, use the original diff --git a/valkey.conf b/valkey.conf index e4ffd0f8ad..4006fcdce1 100644 --- a/valkey.conf +++ b/valkey.conf @@ -1837,6 +1837,25 @@ slowlog-log-slower-than 10000 # You can reclaim memory used by the slow log with SLOWLOG RESET. slowlog-max-len 128 +################################### FAT LOG ################################### + +# The server Fat Log is a system to log packets in queries and responses which +# exceeded a specified size. The size means the total size of the RESP packet. +# +# You can configure the fat log with two parameters: one tells the server +# how big is the packet to exceed in order for the query or response to get +# logged, and the other parameter is the length of the fat log. When a new +# command is logged the oldest one is removed from the queue of logged commands. + +# The following size is a memory config, so it is possible to specify it in +# the usual form of 1kb 2mb 5GB and so forth. And a value of zero forces the +# logging of every query and response. +fatlog-log-bigger-than 1mb + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the fat log with FATLOG RESET. +fatlog-max-len 128 + ################################ LATENCY MONITOR ############################## # The server latency monitoring subsystem samples different operations